Replies: 1 comment 5 replies
-
|
A subprocess would be the typical solution. No need to write a driver when you can launch a process and manage its stdin and stdout. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to expose a Textual
Appwithin an SSH terminal server I'm building. As such,stdinandstdoutin the Python environment belong to the server, not the client connecting to the service; those are actuallyIOobjects (asyncioQueues under the hood, I believe).I've managed to get the client's
stdouttaken care of by way of a customDriverimplementation and overriddenwriteandflushmethods, but I'm not seeing anything in there that would let me do the opposite for input (e.g.read). Methods such as rich'sPrompt.askprovide a way to accomplish this, so it would be wonderful if the same was true of Textual.Since this is a single-threaded, single-process asyncio server, monkey-patching
stdinis not an option. That would not only break the server'sstdin, but would also not work well when multiple clients are connected simultaneously with their own, individual sessions.Beta Was this translation helpful? Give feedback.
All reactions