ending a string with a backslash

Terry Reedy tjreedy at udel.edu
Sun Apr 30 21:34:46 EDT 2006


"John Salerno" <johnjsal at NOSPAMgmail.com> wrote in message 
news:445546c8$0$13341$c3e8da3 at news.astraweb.com...
>I have this:
>
> subdomain = raw_input('Enter subdomain name: ')
>
> path = r'C:\Documents and Settings\John Salerno\My Documents\My
> Webs\1and1\johnjsalerno.com\' + subdomain

For any direct use of paths within Python (to open a file, change 
directory, etc), forward slashes work fine, avoiding backslash problems.

tjr






More information about the Python-list mailing list