Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Is there a built-in way to relatively trivially, with Python or C# code, end up with a TextIOWrapper which is based on a C# Stream object?

My end goal pretty much what sys.stdout and sys.stdin are (but with a different Stream).

var stdin = PythonIOModule.CreateConsole(this, io, ConsoleStreamType.Input, "<stdin>", out StreamBox sstdin);

Above is pretty close to what I'm looking for, but it's internal and I think it would be tricky to actually use it.

You must be logged in to vote

I think you could do something like io.TextIOWrapper(open(myStream)). Not sure how well it works though...

Replies: 1 comment · 1 reply

Comment options

I think you could do something like io.TextIOWrapper(open(myStream)). Not sure how well it works though...

You must be logged in to vote
1 reply
@Muny
Comment options

That does indeed work well for my use-case. Thanks! Can't believe I didn't think to try open()

Answer selected by Muny
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.