By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,760 Members | 1,128 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,760 IT Pros & Developers. It's quick & easy.

Unnormalizing normalized path in Windows

P: n/a
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
Jun 29 '08 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Julien <jp*****@gmail.comwrote:
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...
Yes, it's called os.path.normpath. Did you actually try it before posting?
>>print os.path.normpath('C:/temp/my_dir/bla.txt')
C:\temp\my_dir\bla.txt
Jun 29 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.