By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,932 Members | 1,944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,932 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.

Can anyone help?

Thanx in advance

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"questioner" <bs*******@dspace.de> wrote in message news:<28******************************@localhost.t alkaboutprogramming.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?
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.