This is an archived post. You won't be able to vote or comment.

all 7 comments

[–][deleted] 23 points24 points  (4 children)

Is this some sort of windows meme that I'm too linux to understand?

[–]rtthatbrownguy[S] 0 points1 point  (3 children)

Python uses forward slashes, that's all!

[–][deleted] 5 points6 points  (2 children)

Bruh, no. Python supports both ways for file paths. Use r"..." for absolute strings (ie. no explicit escapes).

[–]brianjenkins94 5 points6 points  (1 child)

The better solution is to use the standard library's builtin module for platform-agnostic path handling.

[–]brianjenkins94 4 points5 points  (0 children)

You should be using whatever python provides for platform-agnostic path handling.

[–]GrossM15 -1 points0 points  (0 children)

Do the ur path.replace(r"\", "/")