Re: [Tutor] about calling external program in Python

2006-05-17 Thread Alan Gauld
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

Re: [Tutor] about calling external program in Python

2006-05-17 Thread Mu Mu
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

Re: [Tutor] about calling external program in Python

2006-05-17 Thread Alan Gauld
"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

Re: [Tutor] about calling external program in Python

2006-05-17 Thread Mu Mu
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:

Re: [Tutor] about calling external program in Python

2006-05-17 Thread Gabriel Dain
> 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

Re: [Tutor] about calling external program in Python

2006-05-17 Thread Suri Chitti
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

Re: [Tutor] about calling external program in Python

2006-05-17 Thread R. Alan Monroe
> 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

Re: [Tutor] about calling external program in Python

2006-05-17 Thread w chun
> 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