RE: OS.SYSTEM ERROR !!!
- From: "Blubaugh, David A." <dblubaugh@xxxxxxxxxx>
- Date: Tue, 30 Sep 2008 14:19:59 -0400
Yes,
I new it was a directory issue. I am new to Python.
Thank You
David Blubaugh
-----Original Message-----
From: Martin Walsh [mailto:mwalsh@xxxxxxxxxx]
Sent: Tuesday, September 30, 2008 1:42 PM
To: python-list@xxxxxxxxxx
Subject: Re: OS.SYSTEM ERROR !!!
Blubaugh, David A. wrote:
To All,<snip>
I have been attempting to execute the following program within the
Python environment:
<snip>
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")
I believe I may be missing something here that prevents the executable
file working within python from utilizing this (.dat). The printed
final error is the following:
ERROR opening inputs/io/control.dat
Does anyone know what that could be ??
Based on your description, it seems pretty obvious (and easy to confirm)
that Myprogram.exe needs to be run from its containing directory
("C:\myprogramfolder\run"). Try something like this...
import os
pwd = os.getcwd()
os.chdir('c:/myprogramfolder/run')
os.system("Myprogram.exe 1 1 acc 0")
os.chdir(pwd)
HTH,
Marty
This e-mail transmission contains information that is confidential and may be
privileged. It is intended only for the addressee(s) named above. If you receive
this e-mail in error, please do not read, copy or disseminate it in any manner.
If you are not the intended recipient, any disclosure, copying, distribution or
use of the contents of this information is prohibited. Please reply to the
message immediately by informing the sender that the message was misdirected.
After replying, please erase it from your computer system. Your assistance in
correcting this error is appreciated.
.
- Prev by Date: RE: OS.SYSTEM ERROR !!!
- Next by Date: Re: r"<path>"
- Previous by thread: RE: OS.SYSTEM ERROR !!!
- Next by thread: Re: OS.SYSTEM ERROR !!!
- Index(es):
Relevant Pages
|