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