I use the cmd module to create an interactive shell.
The workflow is a usual one: enter command, print result. 开发者_JAVA技巧But the result will be processed asynchronously,then stacked in a queue. I then need some way to get it back into my shell to display it.
How can I push data from ouside my shell into my shell and print it ? Should I use a pipe or a signal ? I have no clue.
I mainly need something that works underlinux but cross platform is always a nice to have.
If it's only for display purposes, you can just print
the result to c.stdout
(c
is cmd.Cmd
object). Will that work for you?
精彩评论