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

Q

questioner

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
 
A

A. Lloyd Flanagan

questioner said:
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top