On Thu, Sep 5, 2013, at 23:33, Tim Roberts wrote:
> random...@fastmail.us wrote:
> >
> >Of course, in 99% of situations where you can use a windows pathname in
> >Python, you are free to use it with a forward slash instead of a
> >backslash.
> 
> This is actually worth repeating, because it's not well known.
> 
> ALL Windows APIs handle forward and backward slashes interchangably.  It
> is only the command interpreter that requires the backslash.

Technically, that's not strictly true. There are certain strings you can
open that will only work with backslashes, relating to device paths
and/or the magic \\?\ prefix that removes the PATH_MAX limit
(CreateFileW only). That was what I meant by 99%.

And many situations in the command interpreter that require a backslash
can be used with forward slash by surrounding the string in quotes,
which you need to do anyway when you have an arbitrary string that may
contain spaces.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to