executable "wrapper" gui -- advice sought

Donn Cave donn at oz.net
Sun Apr 23 00:04:55 EDT 2000


Quoth "Grant Goodyear" <g2boojum at hotmail.com>:
| I'm in the process of writing an exceedingly simple gui that will take an
| already existing binary executable and input text file (I don't want to
| break the
| working system!) and allow the user to modify the input arguments,
| if desired, and then start the executable.  That part is straightforward.
| What I'm not sure how to do is to capture the executable's std out as
| it's generated.  My goal is to echo that output to a seperate window, and
| also to use it to generate a periodically updated html "status report" so
| that the program's progress can be monitored remotely.  Working
| through the gui aspects isn't all that difficult, but I have _no_ idea how
| to grab the executable's std out _while it is running_ and then have the
| python gui do something (anything!) with that data.  Any advice?

To start with, have you decided what operating system you're
going to use for this project?  That will matter a lot!  It
sort of sounds like we're on some type of UNIX, but it may
be important which one.

Can you modify the ``existing binary executable'', if it turns
out to have some minor problems with this arrangement?

Does it have a generally teletype-like interface, where its
output appears at the bottom and everything eventually will
scroll off the top, or does is it a ``full screen'' system?

If you'd rather just start bashing around on something, you
might look at os.popen().  Or depending on your UNIX flavor,
the "pty" module might carry the day.

	Donn Cave, donn at oz.net



More information about the Python-list mailing list