473,473 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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\runMyprogram.exe 1 1 acc 0

The executable would execute perfectly.
Because you execute it in the necessary directory.
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")
This does not execute it in the proper directory.
os.getcwd() will tell you where you are -- mostly likely .../Pythonx.y.

Try:
os.chdir("C:/myprogramfolder/run") # / works fine, and without r prefix
os.system("Myprogram.exe 1 1 acc 0")
The executable file would start to execute until it would print an error
stating that it cannot use a (.dat) file, which is located under the
following directory:

C:\myprogramfolder\run\inputs\io\control.dat
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 ??
That file does not exist in the Pythonx.y directory where the program
starts ;-).

tjr

Sep 30 '08 #1
0 1053

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: petro | last post by:
Hello all, My asp.net web application works on my machine but I get the following error on our test web server, There is only one oracle home on the test server. Does anyone know how to resolve...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
2
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
0
by: nicomp | last post by:
I created a Web Service: I imported System.Data.SqlClient so I could access SQL server tables programmatically. The web service builds and deploys with no problems. When I try to add the...
2
by: BruceWho | last post by:
I downloaded boost1.35.0 and built it with following command: bjam --toolset=msvc-7.1 --variant=release --threading=multi -- link=shared --with-system stage and it failed to compile, error...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.