OS.SYSTEM ERROR !!!

giltay at gmail.com giltay at gmail.com
Tue Sep 30 13:40:10 EDT 2008


On Sep 30, 1:21 pm, "Blubaugh, David A." <dbluba... at belcan.com> wrote:
> 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
[snip]
> import os
>
> os.system(r"C:\myprogramfolder\run\Myprogram.exe 1 1 acc 0")
[snip]
> ERROR opening inputs/io/control.dat
[snip]

I would add the following line right before your call to os.system:

os.chdir(r'C:\myprogramfolder\run')

If you have to change directories to run it properly in the Windows
shell, then you need to do it in Python, too.

     HTH,
Geoff G-T




More information about the Python-list mailing list