Really, really annoying problem

Brett Lempereur a.lempereur
Wed Sep 20 21:37:03 CEST 2000


> >>> a = "\\"
> >>> a
> '\\'
> >>> print a
> \

I think that might be the problem, i'm using this method to get the Filename
for a config file (in your example >>> a), so what i want might be

"C:\Program Files\My Python App\Lib\Config\ppdump.txt"

but what Python's giving me is:

"C:\\Program Files\\My Python App\\Lib\\Config\\ppdump.txt"

which returns an error when i try to open the file for writing, because it's
an invalid path.

For some reason, it doesn't figure that "\\" should be "\"





More information about the Python-list mailing list