maybe a popen question... or something else?

dude erniedude at gmail.com
Mon Aug 6 19:00:10 EDT 2007


Working on Windows XP
Say I have a Windows executable, foo.exe.
foo.exe is a command line tool that can take a number of different
arguments and perform corresponding actions.

I want to invoke foo.exe from a Python script (using whatever will
work best).  I want to continuously pass arguments to foo.exe in
between doing other stuff from within my Python script.

Some pseudo code:

processHandle = invoke("foo.exe") # what python module should "invoke"
be here?

doUnrelatedStuff()

processHandle.passArgs("arg1 arg2") # The same foo.exe I invoked above
gets these args for processing

doMoreUnrelatedStuff()

processHandle.passArgs("arg3 arg4") # The same foo.exe I invoked above
gets these args for processing

processHandle.close() # "foo.exe is destroyed"

Thanks for any help.




More information about the Python-list mailing list