os.path.normpath question

Bart xc68000 at gmail.com
Mon Jun 7 11:58:11 EDT 2010


I'm using this and ran across backslash issues in one of my paths.

     archpath = os.path.normpath('E:\foo\FTP\HLS\archive')

was translating to:

     E:\lsfprod\law\uch_interfaces\FTP\HLSrchive

which caused me to start using the 'raw' declaration before the path
string like this:

     archpath = os.path.normpath(r'E:\foo\FTP\HLS\archive')

Is this the right way to use this?




More information about the Python-list mailing list