this post was submitted on 01 Feb 2025
1066 points (99.4% liked)

Programmer Humor

20251 readers
1487 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 90 points 17 hours ago (2 children)

I hate that I need to use escape characters when creating something for windows.

[–] [email protected] 26 points 17 hours ago (2 children)

Python raw strings to the rescue!

[–] [email protected] 33 points 17 hours ago

Pathlib is the answer.

[–] [email protected] 17 points 16 hours ago (2 children)

Nobody is stopping you from using forward slashes. Python will translate the path for the current platform.

[–] [email protected] 2 points 8 hours ago

Python doesn't have to. Windows supports both out of the box. Has been for many, many years

[–] [email protected] 2 points 15 hours ago
[–] [email protected] 14 points 17 hours ago

Try pathlib. All your problems solved.