cm0002@lemmy.world to Programmer Humor@programming.dev · 2 days agoSpecifying file pathslemmy.mlimagemessage-square127fedilinkarrow-up11.38Karrow-down113cross-posted to: linuxmemes@lemmy.world
arrow-up11.37Karrow-down1imageSpecifying file pathslemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 2 days agomessage-square127fedilinkcross-posted to: linuxmemes@lemmy.world
minus-squareNicht BurningTurtle@feddit.orglinkfedilinkarrow-up100·2 days agoI hate that I need to use escape characters when creating something for windows.
minus-squarePennomi@lemmy.worldlinkfedilinkEnglisharrow-up30arrow-down1·2 days agoPython raw strings to the rescue!
minus-squareunalivejoy@lemm.eelinkfedilinkEnglisharrow-up19·2 days agoNobody is stopping you from using forward slashes. Python will translate the path for the current platform.
minus-squareLichtblitz@discuss.tchncs.delinkfedilinkarrow-up3·2 days agoPython doesn’t have to. Windows supports both out of the box. Has been for many, many years
minus-squareDiplomjodler@lemmy.worldlinkfedilinkarrow-up16·2 days 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.