Julien <[EMAIL PROTECTED]> wrote:

> 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
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to