@cm0002 to Programmer [email protected] • 1 month agoSpecifying file pathslemmy.mlimagemessage-square130arrow-up11.45Karrow-down114
arrow-up11.44Karrow-down1imageSpecifying file pathslemmy.ml@cm0002 to Programmer [email protected] • 1 month agomessage-square130
minus-squareNicht BurningTurtlelinkfedilink103•1 month agoI hate that I need to use escape characters when creating something for windows.
minus-squareunalivejoylinkfedilinkEnglish17•1 month agoNobody is stopping you from using forward slashes. Python will translate the path for the current platform.
minus-square@[email protected]linkfedilink5•1 month 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
Try pathlib. All your problems solved.