windows file names in Python

r.e.s. r.s at
Wed Feb 18 23:13:17 CET 2004

<beliavsky at> wrote in message
news:3064b51d.0402181333.12d57963 at
> I know to use "\\" as the separator in Windows file names to get them
> recognized in Python. Is there a way to get "\" recognized as a
> directory separator?

Like this, for example? ...

fpath = r'C:\Documents and Settings\res\test.txt'
f = open(fpath,'wb')


More information about the Python-list mailing list