@cm0002@lemmy.world to Programmer Humor@programming.dev • 2 months agoSpecifying file pathslemmy.mlimagemessage-square132fedilinkarrow-up11.46Kcross-posted to: linuxmemes@lemmy.worldprogrammerhumor@lemmy.ml
arrow-up11.46KimageSpecifying file pathslemmy.ml@cm0002@lemmy.world to Programmer Humor@programming.dev • 2 months agomessage-square132fedilinkcross-posted to: linuxmemes@lemmy.worldprogrammerhumor@lemmy.ml
minus-squareNicht BurningTurtlelinkfedilink105•2 months agoI hate that I need to use escape characters when creating something for windows.
minus-squareunalivejoylinkfedilinkEnglish19•2 months agoNobody is stopping you from using forward slashes. Python will translate the path for the current platform.
minus-square@Lichtblitz@discuss.tchncs.delinkfedilink5•2 months agoPython doesn’t have to. Windows supports both out of the box. Has been for many, many years
I hate that I need to use escape characters when creating something for windows.
Python raw strings to the rescue!
Pathlib is the answer.
Nobody is stopping you from using forward slashes. Python will translate the path for the current platform.
Python doesn’t have to. Windows supports both out of the box. Has been for many, many years
Good to know!
Try pathlib. All your problems solved.