cm0002@lemmy.world to Programmer Humor@programming.dev · 20 hours agoSpecifying file pathslemmy.mlimagemessage-square93fedilinkarrow-up11.13Karrow-down18cross-posted to: programmerhumor@lemmy.ml
arrow-up11.13Karrow-down1imageSpecifying file pathslemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 20 hours agomessage-square93fedilinkcross-posted to: programmerhumor@lemmy.ml
minus-squareNicht BurningTurtle@feddit.orglinkfedilinkarrow-up93·20 hours agoI hate that I need to use escape characters when creating something for windows.
minus-squareDiplomjodler@lemmy.worldlinkfedilinkarrow-up14·20 hours agoTry pathlib. All your problems solved.
minus-squarePennomi@lemmy.worldlinkfedilinkEnglisharrow-up27arrow-down1·20 hours agoPython raw strings to the rescue!
minus-squareunalivejoy@lemm.eelinkfedilinkEnglisharrow-up18·19 hours agoNobody is stopping you from using forward slashes. Python will translate the path for the current platform.
minus-squareLichtblitz@discuss.tchncs.delinkfedilinkarrow-up2·11 hours 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.
Try pathlib. All your problems solved.
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.
Good to know!
Python doesn’t have to. Windows supports both out of the box. Has been for many, many years