[Tutor] about calling external program in Python

w chun wescpy at gmail.com
Wed May 17 11:03:40 CEST 2006


> 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. os.system(r'C:.....).

you mentioned "it doesn't work."  what do you mean by that?  in other
words, what did the Python interpreter do...  give an error, nothing,
etc.?

thanks,
-wesley

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
    http://corepython.com

wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com


More information about the Tutor mailing list