Lena@gregtech.eu to Programmer Humor@programming.devEnglish · 1 year agoI wonder if this was made by AI or a shit programmergregtech.euimagemessage-square111linkfedilinkarrow-up1879arrow-down10
arrow-up1879arrow-down1imageI wonder if this was made by AI or a shit programmergregtech.euLena@gregtech.eu to Programmer Humor@programming.devEnglish · 1 year agomessage-square111linkfedilink
minus-squareUndercoverUlrikHD 🇳🇴@programming.devlinkfedilinkarrow-up4·1 year agoWhat big advantages does pathlib provide? os.path works just fine
minus-squareDiplomjodler@lemmy.worldlinkfedilinkarrow-up9·1 year ago Everything is in one library which offers consistency for all operations. You can use forward slashes on Windows paths, which makes for much better readability. You can access all the parts of a pathlib object with attributes like .stem, .suffix or .parent. You can easily find the differences between paths with .relative_to() You can easily build up complex paths with the / operator (no string additions). Just off the top of my head.
minus-squarenibbler@discuss.tchncs.delinkfedilinkEnglisharrow-up1·edit-21 year agoif you don’t need those, why burden the program with another dependency?
minus-squareDiplomjodler@lemmy.worldlinkfedilinkarrow-up2·1 year agoIt’s in the standard library, just like os or shutil.
What big advantages does pathlib provide? os.path works just fine
Just off the top of my head.
if you don’t need those, why burden the program with another dependency?
It’s in the standard library, just like os or shutil.