system-output to wxpython-window

Roman Yakovenko romany at actimize.com
Wed Jun 26 09:27:51 EDT 2002


According to what you define as simple ?
You need to open pipe and then all you read is going to the output.

 streamInput, streamOutput, streamError = popen3('C:\\run.bat')
 while 1:
            sData = streamOutput.readline()
            if not sData:
                break
            writeToGUI(sData) # <-- your function
answer = streamOutput.close()

Also I think after a few minutes of running this code you will want to write multi threading. 
It is also simple. I have working example. I think exactly what you need. 

Roman

-----Original Message-----
From: Klaus Reinhardt [mailto:K.Rdt at TU-Berlin.DE]
Sent: Wednesday, June 26, 2002 7:20 AM
To: Python
Subject: system-output to wxpython-window


---------------------------------------------------------------------
Hi

I have some batch-files, which I want to
invoke from a nice wxpython-frame. So
I did   system("0m.bat");   but the output
is coming to the DOS-shell-window. Is
there a simple way to do the job. Best case
would be one menue-window and another
for output.

		K at Rdt
---------------------------------------------------------------------





-- 
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list