Python and wxPython as front end to C++ program

Ken Seehof kens at sightreader.com
Thu May 17 03:06:00 EDT 2001


Yup.  Use os.popen.  This lets you run any command line and opens
the output stream as a pipe.  If you need access to stderr and/or input
stream, use popen3.  Of course, once you've got that, it doesn't matter
what GUI you use.  I like wxPython too.

>>> import os
>>> f = os.popen('echo hey')
>>> print f.read()
hey

>>> f.close()

- Ken Seehof   mailto:kseehof at neuralintegrator.com

----- Original Message -----
From: "Doug Farrell" <dfarrell01 at earthlink.net>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Friday, May 11, 2001 1:44 PM
Subject: Python and wxPython as front end to C++ program


> Hi,
>
> I've written a command line utility for the Sun machine at work in C++
that
> I'd like to put a nicer interface around. Is it possible to write a Python
> program with wxPython that would act as a GUI 'wrapper' to this command
line
> utility? The utility program accepts command line arguments to do its work
> and only outputs to cout and cerr. Can Python feed the utility an argument
> (which I think is easy) and catch and display the cout/cerr messages?
>
> Thanks in advance,
> Doug
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list