473,434 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

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 1052

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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
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...

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.