@cm0002@lemmy.world to Programmer Humor@programming.dev • 2 months agoSpecifying file pathslemmy.mlimagemessage-square133fedilinkarrow-up11.47Karrow-down114
arrow-up11.46Karrow-down1imageSpecifying file pathslemmy.ml@cm0002@lemmy.world to Programmer Humor@programming.dev • 2 months agomessage-square133fedilink
minus-squareNicht BurningTurtlelinkfedilink105•2 months agoI hate that I need to use escape characters when creating something for windows.
minus-squareunalivejoylinkfedilinkEnglish18•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.