SwordInStone@lemmy.world to Python@programming.dev · edit-26 个月前YSK: there is a library called pathlib with different methods for accessing files which you might like since they do not require a context manager message-squaremessage-square9linkfedilinkarrow-up128arrow-down113file-text
arrow-up115arrow-down1message-squareYSK: there is a library called pathlib with different methods for accessing files which you might like since they do not require a context manager SwordInStone@lemmy.world to Python@programming.dev · edit-26 个月前message-square9linkfedilinkfile-text
https://docs.python.org/3/library/pathlib.html I’m creating this post mainly so that I don’t forget the name again.
minus-squaredallen@programming.devlinkfedilinkarrow-up4·6 个月前I subconsciously replace os.path with pathlib whenever touching any module for a refactor.
I subconsciously replace
os.path
withpathlib
whenever touching any module for a refactor.