[Ironpython-users] Using System.Diagnostics.Process results in Errno 22

Jackie Sproat JackieSproat at smarttech.com
Wed Dec 19 15:20:38 CET 2012


Thanks for the suggestion - I tried both solutions but, neither one of them solves the problem.
System.Diagnostics.Process seems to only work if you want to launch an .exe with given arguments

-----Original Message-----
From: Jeff Hardy [mailto:jdhardy at gmail.com] 
Sent: Tuesday, December 18, 2012 4:23 PM
To: Jackie Sproat
Cc: ironpython-users at python.org
Subject: Re: [Ironpython-users] Using System.Diagnostics.Process results in Errno 22

On Tue, Dec 18, 2012 at 1:54 PM, Jackie Sproat <JackieSproat at smarttech.com> wrote:
> 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" '

My guess is the backslashes are causing problems. You have two options:

1) Escape the backslashes:
    file_name = 'java -jar "C:\\Program Files\\Sikuli X\\sikuli-script.jar" '

2) Use a raw string, which disables backslash escapes (also useful for regexes):
    file_name = r'java -jar "C:\Program Files\Sikuli X\sikuli-script.jar" '

- Jeff




More information about the Ironpython-users mailing list