How do I start from python sth like "MyExe.exe InFile"?

A. Lloyd Flanagan alloydflanagan at comcast.net
Fri May 14 16:31:30 EDT 2004


"questioner" <bstoyanov at dspace.de> wrote in message news:<28bcfc204dec5fe9060a7b0d1b0fba47 at localhost.talkaboutprogramming.com>...
> Hi folks,
> 
> Id appreciate if you can help:
> I want to start an exe which takes as an argument filename. What I tried
> was:
> 
> os.spawnl(os.P_NOWAIT,('processor.exe'),'filename.ext'))
> 
> I also tried:
> os.execl(r'DRIVE:\WINNT\system32\cmd.exe',
> '/k',('processor.exe'),'filename.ext'))
> but is simply the command line and stopped.
> However I didnt achieve the expected result and got some number like:
> 788.

Since you specified os.P_NOWAIT in the spawnl() call, it didn't return
an exit code, but rather the process ID of the spawned process.  If
you were expecting the exit code, you should be using os.P_WAIT.

Other than that, we could really use more detail to help us answer
this question.  What exactly did the system do and print when you made
the call?  What did you expect/want it to do?



More information about the Python-list mailing list