I think you may be confiused about sys.path.
import os
import sys
sys.path.append('C:\Program Files\EPANET2')
os.system('epanet2d.exe C:\simulation_test\Network3_1.inp
C:\simulation_test\Network3_1.out')
--
sys.path is the path that Python uses to look
I redid the following:
import osimport syssys.path.append('C:\Program Files\EPANET2')os.system('epanet2d.exe C:\simulation_test\Network3_1.inp C:\simulation_test\Network3_1.out')
and safed this as test.py
In the Pythonwin interface to run. I got nothing.
Then I added 'C:\Program Files\EPAN
"Mu Mu" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I tried the following:
> >>> os.system(r'C:\\simulation test\\epanet2d.exe C:\\simulation
> test\\Network3_1.inp C:\\simulation test\\Network3_1.out')
> 1
Any non zero return value means that an error occurred.
The os.system c
Dear all,
I tried the following:
>>> os.system(r'C:\\simulation test\\epanet2d.exe C:\\simulation test\\Network3_1.inp C:\\simulation test\\Network3_1.out')1>>> os.system('C:\simulation test\epanet2d.exe C:\simulation test\Network3_1.inp C:\simulation test\Network3_1.out')
1>>> os.system(r'C:
> os.system('C:\Program Files\EPANET2\epanet2d.exe
> C:\simulation test\Network3_1.inp C:\simulation
> test\Network3_1.out')
have you tried the following?
os.system('"C:\Program Files\EPANET2\epanet2d.exe" "C:\simulation
test\Network3_1.inp" "C:\simulation test\Network3_1.out'"')
--
Gabriel Dai
Does it return any error message??
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mu Mu
Sent: Wednesday, May 17, 2006
11:47 AM
To: Tutor@python.org
Subject: [Tutor] about calling
external program in Python
Dear all,
I'm trying to call an exec
> Dear all,
> I'm trying to call an executable program in Python. I did the following, but
> it doesn't work. Any help is appreciated.
> os.system('C:\Program Files\EPANET2\epanet2d.exe C:\simulation
> test\Network3_1.inp C:\simulation test\Network3_1.out')
My first guess: you need quotes arou
> I'm trying to call an executable program in Python. I did the following, but
> it doesn't work. Any help is appreciated.
>
> os.system('C:\Program Files\EPANET2\epanet2d.exe
> C:\simulation test\Network3_1.inp C:\simulationtest\Network3_1.out')
try putting an "r" in front of the string, i.e. o