Unnormalizing normalized path in Windows

Julien jphalip at gmail.com
Sun Jun 29 09:39:17 EDT 2008


Hi,

In Windows, when a path has been normalized with os.path.normpath, you
get something like this:

C:/temp/my_dir/bla.txt   # With forward slashes instead or backward
slashes.

Is it possible to revert that?

>>> magic_function('C:/temp/my_dir/bla.txt')
'C:\temp\my_dir\bla.txt'

I wonder if there's a standard function to do that...

Thanks a lot!

Julien



More information about the Python-list mailing list