[Tutor] Re: W2K environment...

Emile van Sebille emile@fenx.com
Thu, 26 Sep 2002 13:17:26 -0700


"steve lewis" <steve@openiso.com> wrote in message
news:4198.199.66.1.5.1033070532.squirrel@www.absolutenettech.com...
> i have mine installed under c:\ also, just making sure i was not
missing
> something in all of the online stuff and books i am using.
> as my learning script i am doing something simple, but am running into
> some problems.
> i am creating a script to launch apps on my w2k pro box at work.
>
> ##code snip
>
> 1 import os
> 2
> 3 #start apps
> 4 #os.system('start C:\WINNT\NOTEPAD.exe')
> 5 #os.system('start C:\WINNT\explorer.exe')
> 6 os.system('start "C:\Program Files\NoteTab Light\NoteTab.exe"')
> 7 os.system('start "C:\Reflection\tyson1.r2w"')
>

Backslashes introduce a control character when included in python
strings.  Either double the character, try forward slashes, or use raw
strings instead.  I expect all three of these would work:

os.system(r'start "C:\Reflection\tyson1.r2w"')
os.system('start "C:\\Reflection\\tyson1.r2w"')
os.system('start "C:/Reflection/tyson1.r2w"')

HTH,

--

Emile van Sebille
emile@fenx.com

---------