cm0002@lemmy.world to Programmer Humor@programming.dev · 15 hours agoSpecifying file pathslemmy.mlimagemessage-square72fedilinkarrow-up1945arrow-down17cross-posted to: [email protected][email protected]
arrow-up1938arrow-down1imageSpecifying file pathslemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 15 hours agomessage-square72fedilinkcross-posted to: [email protected][email protected]
minus-squareNicht BurningTurtle@feddit.orglinkfedilinkarrow-up82·14 hours agoI hate that I need to use escape characters when creating something for windows.
minus-squarePennomi@lemmy.worldlinkfedilinkEnglisharrow-up24arrow-down1·14 hours agoPython raw strings to the rescue!
minus-squareunalivejoy@lemm.eelinkfedilinkEnglisharrow-up17·14 hours agoNobody is stopping you from using forward slashes. Python will translate the path for the current platform.
minus-squareLichtblitz@discuss.tchncs.delinkfedilinkarrow-up1·6 hours agoPython doesn’t have to. Windows supports both out of the box. Has been for many, many years
minus-squareDiplomjodler@lemmy.worldlinkfedilinkarrow-up13·14 hours 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.