Hi,
Using Windows XP Home & python 234
I am trying to start python programs that run Panda 3D without having to
open command prompt and type a path every time I run a program.
This pandastart.bat file works...
cd C:\Panda3D-1.2.3\mystuff
ppython bvd.py
and from python shell this works....
>>> subprocess.Popen("pandastart.bat")
<subprocess.Popen object at 0x00E07DD0> But it is not flexible to start other file names..
So I would like to write a python script similar to this....
import subprocess
panda = raw_input("Enter name of Panda python program to start (fileName.py)") subprocess.Popen("C:\panda3D-1.2.3\mystuff\panda") But this is the result...
>>>
subprocess.Popen("C:\panda3D-1.2.3\mystuff\bvd.py")
Traceback (most recent call last): File "<pyshell#19>", line 1, in ? subprocess.Popen("C:\panda3D-1.2.3\mystuff\bvd.py") File "C:\Python24\lib\subprocess.py", line 542, in __init__ errread, errwrite) File "C:\Python24\lib\subprocess.py", line 706, in _execute_child startupinfo) WindowsError: [Errno 123] The filename, directory name, or volume label syntax is incorrect Also tried the below (change to the path) with result as indicate
below....
>>> subprocess.Popen("C:\panda3D-1.2.3\mystuff
bvd.py")
Traceback (most recent call last): File "<pyshell#20>", line 1, in ? subprocess.Popen("C:\panda3D-1.2.3\mystuff bvd.py") File "C:\Python24\lib\subprocess.py", line 542, in __init__ errread, errwrite) File "C:\Python24\lib\subprocess.py", line 706, in _execute_child startupinfo) WindowsError: [Errno 5] Access is denied Have tried using os.system and os.startfile with similar results
Suggested solution?
Thanks.
|
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor