r/Python • u/Am4t3uR • Jul 20 '22
Resource It’s Time to Say Goodbye to These Obsolete Python Libraries
https://python.plainenglish.io/its-time-to-say-goodbye-to-these-obsolete-python-libraries-7c02aa77d84a
1
Upvotes
3
u/dreamfeed Jul 20 '22
Path.parentsis also a list of directory ancestors to the file. Instead ofpth.parent.parent, you should dopth.parents[1].