[Tutor] slashes in paths

Jim Mooney cybervigilante at gmail.com
Sat Jul 20 22:16:03 CEST 2013


Dominik George <nik at naturalnet.de>

> Well, who says it is a Python convention? It is a POSIX convention, and
> in your code above you jsut used that. Because Python is such a good
> friend, it doesn't blow up but take what you gave to it. As you can see
> by using the os.path.join() function is that on Windows, when you ask
> Python to do the work for you, it really uses *single* backslashes.

But oddly, it makes all slashes forward if I end the path with a
forward slash, so it's not consistent with itself. BTW, is ending a
path with a slash a Linux requirement, or just a convention, or a
who-cares-either-way? I forget since I've been on windows a long time,
and it accepts either method. I guess the best thing is to always end
all paths with a forward slash, catching both OS's and being
consistent.

Jim


More information about the Tutor mailing list