Luis Norambuena@programming.devcakeM to Python@programming.devEnglish · 2 years agoPython's pathlib modulewww.pythonmorsels.comexternal-linkmessage-square10linkfedilinkarrow-up118arrow-down10file-text
arrow-up118arrow-down1external-linkPython's pathlib modulewww.pythonmorsels.comLuis Norambuena@programming.devcakeM to Python@programming.devEnglish · 2 years agomessage-square10linkfedilinkfile-text
minus-squareDiplomjodler@lemmy.worldlinkfedilinkarrow-up3arrow-down1·2 years agoThey could have chosen a better operator. But the functionality is fantastic. Makes working with paths so much easier. And you can even use slashes on windows paths.
minus-squareleds@feddit.dklinkfedilinkarrow-up8·2 years agoIt makes the code so much more clean and readable since you’re dropping multiple levels of brackets , for example os.path.join( a, b, os.path.dirname(c)) Becomes a / b / c.parent I really like it
minus-squareDiplomjodler@lemmy.worldlinkfedilinkarrow-up3arrow-down1·2 years agoI always hated os.path. pathlib is just so much better.
They could have chosen a better operator. But the functionality is fantastic. Makes working with paths so much easier. And you can even use slashes on windows paths.
It makes the code so much more clean and readable since you’re dropping multiple levels of brackets , for example
os.path.join( a, b, os.path.dirname(c))Becomes
a / b / c.parentI really like it
I always hated os.path. pathlib is just so much better.