@[email protected] to Programmer [email protected] • 3 months agoSpecifying file pathslemmy.mlimagemessage-square131fedilinkarrow-up11.27Kcross-posted to: [email protected][email protected]
arrow-up11.27KimageSpecifying file pathslemmy.ml@[email protected] to Programmer [email protected] • 3 months agomessage-square131fedilinkcross-posted to: [email protected][email protected]
minus-squareNicht BurningTurtlelinkfedilink85•3 months agoI hate that I need to use escape characters when creating something for windows.
minus-squareunalivejoylinkfedilinkEnglish15•3 months agoNobody is stopping you from using forward slashes. Python will translate the path for the current platform.
minus-square@[email protected]linkfedilink5•3 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.
Good to know!
Python doesn’t have to. Windows supports both out of the box. Has been for many, many years
Try pathlib. All your problems solved.