python call external program (WHAT THE?!)

Ivan Van Laningham ivanlan at callware.com
Tue Sep 14 12:14:24 EDT 1999


Hi All--

Ben Thomas wrote:
> 
> I just tried but putting the batch file in three places on a drive. The I tried
> them all.
> 
> system('d:\mybat.bat') = ok
> system('d:\data\mybat.bat') = ok
> system('d:\data\vacman\mybat.bat') = fails, it works fine from DOS prompt!
> 
> what gives?
> Ben
> 

Python strings are like C strings.  You can use either

	system('d:\\mybat.bat')

or

	system(r'd:\mybat.bat')

In a normal C string, the \ signals that the next character is to be
combined w/ the \ and a single character produced:  '\n' mean 'newline'.

A raw string, signalled by r'string', attaches no special meaning to the
\

<real-men-eat-raw-strings-for-breakfast-lunch-and-dinner>-ly y'rs,
Ivan
----------------------------------------------
Ivan Van Laningham
Callware Technologies, Inc.
ivanlan at callware.com
ivanlan at home.com
http://www.pauahtun.org
See also: 
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
----------------------------------------------




More information about the Python-list mailing list