Printing with raw_input
Peter Otten
__peter__ at web.de
Mon Feb 15 07:05:58 EST 2010
Joan Miller wrote:
>> > Does `raw_input` uses internally `sys.stdout.write`?
> It was to display the output inside a GUI app. overriding
> `sys.stdout`. And as `print` also uses internally `sys.stdout.write`
> then can be used `print` the shell script and get the output too in
> the GUI, cann't it?
It should be easy to collect data written with print and show it in a gui,
but I can't see how you would integrate raw_input() into a gui app.
As to shell scripts, you can invoke them via subprocess, or, if the script
needs user interaction, via pexpect.
Peter
More information about the Python-list
mailing list