in Python 2.6, use the string enclosed in quotation marks "and apostrophes". Also change single / double //. Your working example would look like this:
import os os.system("'C://Documents and Settings//flow_model//flow.exe'")
You can also use any parameters if your program accepts them.
os.system('C://"Program Files (x86)"//Maxima-gcl-5.37.3//gnuplot//bin//gnuplot -e "plot [-10:10] sin(x),atan(x),cos(atan(x)); pause mouse"')
finally, you can use a string variable, as an example - plotting using gnuplot directly from python:
this_program='C://"Program Files (x86)"//Maxima-gcl-5.37.3//gnuplot//bin//gnuplot' this_par='-e "set polar; plot [-2*pi:2*pi] [-3:3] [-3:3] t*sin(t); pause -1"' os.system(this_program+" "+this_par)
Bomba Ps Jan 25 '19 at 5:57 2019-01-25 05:57
source share