Lena@gregtech.eu to Programmer Humor@programming.devEnglish · 1 day agoI wonder if this was made by AI or a shit programmergregtech.euimagemessage-square160fedilinkarrow-up1829arrow-down17
arrow-up1822arrow-down1imageI wonder if this was made by AI or a shit programmergregtech.euLena@gregtech.eu to Programmer Humor@programming.devEnglish · 1 day agomessage-square160fedilink
minus-squareUndercoverUlrikHD@programming.devlinkfedilinkarrow-up2·3 hours agoWhat big advantages does pathlib provide? os.path works just fine
minus-squareDiplomjodler@lemmy.worldlinkfedilinkarrow-up5·2 hours 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 hour agoif you don’t need those, why burden the program with another dependency?
minus-squareDiplomjodler@lemmy.worldlinkfedilinkarrow-up1·1 hour 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.