Re: Running a DOS exe file from python

2006-01-27 Thread Peter Hansen
Rinzwind wrote:
 Something like this:
 progname = 'c:\tmp\myprog.exe arg1 '+'-- help'
 os.system(r'progname)

Well, other than the ways in which it wouldn't work:

1. arg1 doesn't get substituted with anything, if that's what you 
meant, but rather is inserted as the literal string arg1.  If you 
meant that just as an example of some other argument that would be 
hardcoded, then it's unclear why you have the + in there since you could 
just have written the whole thing as a single string.

2. You need the 'r' meaning raw string *on the string literal*, in the 
first line, not in the second line.  In your code, the string bound to 
the name progname contains an ASCII TAB character in the third byte, 
after the c and the :, which isn't likely what you wanted.

3. In the second line you have an unterminated string...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Running a DOS exe file from python

2006-01-26 Thread lblr33
I posted this earlier on yahoo groups and then realized that the most
recent post was 2003.  What I didn't realize is that it posted to this
group so I posted it again.

The other post is:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/6dc7c53dd00b99ed/da05733f4a83399f#da05733f4a83399f

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Running a DOS exe file from python

2006-01-26 Thread Rinzwind
Hello,

Something like this:
progname = 'c:\tmp\myprog.exe arg1 '+'-- help'
os.system(r'progname)

should work too.
So you should be able to change progname to any location you need to
start it and all the args to whatever is needed.

-- 
http://mail.python.org/mailman/listinfo/python-list