[Tutor] about calling external program in Python
Alan Gauld
alan.gauld at btinternet.com
Wed May 17 20:43:36 CEST 2006
"Mu Mu" <mumufitt at gmail.com> wrote in message
news:2b9562040605171021k42b5b2c8v60d4952129d1240e at mail.gmail.com...
> 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 call worked and the OS returned an error, which
usually means you got a path wrong or the user running puython
doesn't have access rights to the executable.
> They all returned '1' in the interactive window and gave no result
> in the
> designated output folder. All I saw is a flash of the ms-dos black
> window
> and then disappeared.
>
> I tried ms-dos command line, it works pretty good.
What happens if you try it from the Start->Run dialog?
The CMD box may have some environment settings that are missing
when Python runs.
Alan G.
More information about the Tutor
mailing list