[Ironpython-users] Using System.Diagnostics.Process results in Errno 22
Jackie Sproat
JackieSproat at smarttech.com
Tue Dec 18 22:54:10 CET 2012
Using python I have no problem starting my process with subprocess.Popen('java -jar "C:\Program Files (x86)\Sikuli X\sikuli-script.jar" ' + finalname, shell=True)
But, because the select module is not available, you can't use the subprocess module in IronPython.
So, I have to use System.Diagnostics.Process instead.
However, using this with IronPython, results in Errno 22: The system cannot find the file specified...
file_name = 'java -jar "C:\Program Files\Sikuli X\sikuli-script.jar" '
file_name = "\"" + file_name + "\""
try:
p = Process()
p.StartInfo.UseShellExecute = True
p.StartInfo.RedirectStandardOutput = False
p.StartInfo.FileName = file_name
print p.StartInfo.FileName
p.StartInfo.Arguments = arg_file
print p.StartInfo.Arguments
p.StartInfo.WorkingDirectory = cwd_is
p.Start()
Any suggestions greatly appreciated.
Cheers,
Jackie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipyRunSikuli.py
Type: application/octet-stream
Size: 1732 bytes
Desc: ipyRunSikuli.py
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20121218/e4fd8db2/attachment.obj>
More information about the Ironpython-users
mailing list