I am trying to use the subprocess but I end up with the following problem ( on linux and mac). File not found.
Which is really strange as when I copy my argument directly on a batch. it launches the python module with problem… may be a problem with the string which is not raw ? in this case how to convert a string to raw ?
or other
Here is my code (from plota.py who is trying to launch mplplotter.py module):
mpath = os.getcwdu()
marg = mpath+"\plugins\mplplotter.py"
marg = mpath+"/plugins/mplplotter.py" #for Linux
marg = sys.executable+" "+ marg
print "[marg:] "+marg
subprocess.Popen(marg)
here is the result when i launch plota.py
WE ARE IN PLOTA.PY trying to access the plugin mplplotter
[marg:] /Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python /Users/rfv/Desktop/QME_Beta30/plugins/mplplotter.py
Traceback (most recent call last):
File
“/Users/rfv/Desktop/QME_Beta30/plota.py”, line 35, in ?
subprocess.Popen(marg)
File “/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/subprocess.py”, line 543, in init
errread, errwrite)
File “/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/subprocess.py”, line 975, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
here is the result if i copy directly the argument in a shell… it works and the mplplotter.py is launched correctly…
Amon:~/Desktop/QME_Beta30 rfv$ /Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python /Users/rfv/Desktop/QME_Beta30/plugins/mplplotter.py
In MPL plotter module from plugins QME-DEV
External Plot Process Plotting
any idea ?
Best Regards
Robert
···
Découvrez une nouvelle façon d’obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.