[Tutor] Popen and Prompting
John Fouhy
john at fouhy.net
Wed Aug 31 01:03:16 CEST 2005
On 31/08/05, Faulconer, Steven M. <STEVEN.M.FAULCONER at saic.com> wrote:
> My question for all of you python people; how can I handle programs that MAY
> need input from the command line. I thought about using something like
> pexpect, but the input requests are fairly variable, and may not show up at
> all. Also, I need to tie this in with the Tkinter GUI as well. The binaries
> we are running are written in C, and we have no way of changing that (it's
> in-house software, but the API we have to use does not talk to Python).
Could you kludge it?
eg, change the C programs so that, every time they ask for user input,
they include in the prompt a certain unusual string. Then, any time
your GUI detects this string in the program output, it can pop up a
dialog box asking for user input.
(just a suggestion ... I don't know the best way of dealing with this)
--
John.
More information about the Tutor
mailing list