Re: OS.SYSTEM ERROR !!!



Blubaugh, David A. wrote:
To All,


I have been attempting to execute the following program within the
Python environment:

Myprogram.exe, which means this is an executable file!!

I would usually execute this program (with the appropriate arguments) by
going to following directory within MS-DOS (Windows XP):

C:\myprogramfolder\run> Myprogram.exe 1 1 acc 0


The executable would execute perfectly.


However, when I would try to execute the following lines of source code
within a python script file:

import os

os.system(r"C:\myprogramfolder\run\Myprogram.exe 1 1 acc 0")

Try this:

import subprocess
retval = subprocess.call(
['Myprogram.exe', '1', '1', 'acc', '0'],
cwd='C:\myprogramfolder\run')

Christian

.



Relevant Pages

  • Re: Why I love python.
    ... I can execute a python program just as ... > Perhaps you target system has no Python environment installed. ... Cell phones should be cell phones not multifunction device that can run all ... kinds of apps, need virus scanners etc. ...
    (comp.lang.python)
  • Re: Why I love python.
    ... On 2004-08-13, kosh wrote: ... At least on all the unixes ... I can execute a python program just as transparently as one in ... Perhaps you target system has no Python environment installed. ...
    (comp.lang.python)
  • Re: OS.SYSTEM ERROR !!!
    ... Python environment: ... I would usually execute this program by ... inputs/io/control.dat relative to its current working directory. ...
    (comp.lang.python)
  • Re: OS.SYSTEM ERROR !!!
    ... Python environment: ... I would usually execute this program by ... ERROR opening inputs/io/control.dat ...
    (comp.lang.python)
  • Re: Variable and Dynamic SQL
    ... (Reverse address to reply.) ... "David" wrote in message ... > dynamically built sql statement. ... > execute ...
    (microsoft.public.sqlserver.server)