A problem with subprocess

Colin J. Williams cjw at ncf.ca
Sat Mar 21 03:14:41 CET 2009


Below is a test script:

# tSubProcess.py

import subprocess
import sys
try:
   v= subprocess.Popen('ftype 
py=C:\Python25\Python.exe')
except WindowsError:
   print(sys.exc_info())

Here is the output:

*** Python 2.5.4 (r254:67916, Dec 23 
2008, 15:10:54) [MSC v.1310 32 bit 
(Intel)] on win32. ***
>>> 
Command Line : --Python25
(<type 'exceptions.WindowsError'>, 
WindowsError(2, 'The system cannot find 
the file specified'), <traceback object 
at 0x021864E0>)
>>> 

The doc seems to indicate that the 
command can be in "args", in this case 
"executable" is unnecessary.

Am I misreading the doc?

Colin W.



More information about the Python-list mailing list