Embeded in GUI,Python output ?

James C. Ahlstrom jim at interet.com
Mon Jul 10 13:24:06 EDT 2000


heath7952 at my-deja.com wrote:
> 
> I'm attempting to embed Python inside a GUI. Python will serve as a
> command interpreter. I can type commands in the GUI command window and
> they are being executed correctly, I'm using PyRun_String. The only
> thing I need now is the output from the commands , so I can post them in
> the GUI command window.
> 
> i.e. a = 10
>      print a
> 
> I'd like to be able to get at the output string "10" which should be
> returned, and display it.

This is printed to the "write" method of sys.stdout, so you need to
replace sys.stdout with your own method.

Jim Ahlstrom



More information about the Python-list mailing list