2010-06-04, 00:06
It does make a difference because \ is an escape character, meaning it is used to enter special characters which can't always be typed (ie. \a for a bell (ascii value 7)). You can get around this by either escaping every \ character such that they all look like \\, or prefixing the string with r (r"This is a string"). However, the *nix standard path separator is a /, and while for the most part modern systems will accept either interchangeably, there are some cases (ie. the Xbox) where the system requires it to be one way or the other.
The best way to insure comparability with all systems is to not hard-code a path separator, but instead use the value of os.sep, or better yet call os.path.join() with the pieces of your path and it will automatically insert os.sep between each.
The best way to insure comparability with all systems is to not hard-code a path separator, but instead use the value of os.sep, or better yet call os.path.join() with the pieces of your path and it will automatically insert os.sep between each.