---
title: "Discussion on \"Python pathlib Cookbook: 57+ Examples to Master It (2022)\" | Hashnode"
description: "Discussion on \"Python pathlib Cookbook: 57+ Examples to Master It (2022)\". A mega tutorial with dozens of examples on how to use the pathlib module in Python 3"
url: "https://hashnode.com/posts/python-pathlib/617e57d8d55bde5cb6682432"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Python pathlib Cookbook: 57+ Examples to Master It (2022)](https://miguendes.me/python-pathlib?utm_source=hashnode&utm_medium=feed)

A mega tutorial with dozens of examples on how to use the pathlib module in Python 3

Oct 31, 2021 · 29 min read · miguendes.me  
Updated Jul 2, 2022  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#python3](https://hashnode.com/tag/python3)
-   [#python-beginner](https://hashnode.com/tag/python-beginner)
-   [#python-projects](https://hashnode.com/tag/python-projects)

## Written by

[Miguel Brito](https://hashnode.com/@miguendes)

@miguendes · London, UK

  
[View profile](https://hashnode.com/@miguendes)

Machine Learning Software Engineer - Hobbyst Technical Writer - Interested in Software Testing, Best Practices, Scalability, and Python.

AI Software Engineer based in London, UK with 6+ years of professional experience developing and releasing software in different programming languages - Hobbyist Technical Writer - Interested in Software Testing, Best Practices, Scalability, Machine Learning/AI, and Python.

## Responses 6

Markdown supported · ⌘↵ to post

[gyan guide](https://hashnode.com/@gyanguide45)

[Jul 5, 2024](https://hashnode.com/posts/python-pathlib/617e57d8d55bde5cb6682432/comment/6687e575b22c02ae4f3bb795)

Pretty! This was a really wonderful post. Thank you for providing these details.

[infocampus.co.in/ui-development-training-in-banga…](https://infocampus.co.in/ui-development-training-in-bangalore.html)  
[infocampus.co.in/web-development-training-in-bang…](https://infocampus.co.in/web-development-training-in-bangalore.html) [infocampus.co.in/mern-stack-training-in-bangalore…](https://infocampus.co.in/mern-stack-training-in-bangalore.html) [infocampus.co.in/reactjs-training-in-marathahalli…](https://infocampus.co.in/reactjs-training-in-marathahalli-bangalore.html) [infocampus.co.in/javascript-jquery-training-in-ba…](https://infocampus.co.in/javascript-jquery-training-in-bangalore.html) [infocampus.co.in/data-structure-algorithms-traini…](https://infocampus.co.in/data-structure-algorithms-training-in-bangalore.html) [infocampus.co.in/angularjs-training-in-bangalore.…](https://infocampus.co.in/angularjs-training-in-bangalore.html) [infocampus.co.in](https://infocampus.co.in/) [infocampus.co.in/web-designing-training-in-bangal…](https://infocampus.co.in/web-designing-training-in-bangalore.html) [infocampus.co.in/front-end-development-course-in-…](https://infocampus.co.in/front-end-development-course-in-bangalore.html)

[Evan E. Baird](https://hashnode.com/@mrcartoonster1)

[Dec 23, 2022](https://hashnode.com/posts/python-pathlib/617e57d8d55bde5cb6682432/comment/63a63539b1011ed9ec6cc1c0)

This is an amazing cheatsheet!

[Julio J. Mendoza García-Retamero](https://hashnode.com/@Chukieman)

[Aug 25, 2022](https://hashnode.com/posts/python-pathlib/617e57d8d55bde5cb6682432/comment/6307944e79f56556d0cbad96)

I'm far from considering myself proficient in Python, but one thing I am always struggling with is managing files and paths. I hope this excellent article will let me grasp it once and for all

[Excellence Technology](https://hashnode.com/@Excellencenancy)

[Jul 28, 2022](https://hashnode.com/posts/python-pathlib/617e57d8d55bde5cb6682432/comment/62e23e110b03c4b2903a84c2)

Hi, you are provide a better information to the people for Python . I like the content. It can improve the knowledge of Python.

[Roger Demetrescu](https://hashnode.com/@rdemetrescu)

[Nov 8, 2021](https://hashnode.com/posts/python-pathlib/617e57d8d55bde5cb6682432/comment/61897d73ce9e5f6dfd7858ee)

Amazing article!! Thanks a lot for sharing it!

just found one minor typo:

"Another benefit is that **is** the directory is not empty, ..."

should be

"Another benefit is that **if** the directory is not empty, ..."

[Amit Meel](https://hashnode.com/@viscabar)

[Nov 8, 2021](https://hashnode.com/posts/python-pathlib/617e57d8d55bde5cb6682432/comment/61891853710d816e7a9cd653)

Excellent Article!

[MCCurcio](https://hashnode.com/@MattCC)

[Nov 1, 2021](https://hashnode.com/posts/python-pathlib/617e57d8d55bde5cb6682432/comment/618008b0e0cb9449fc48d338)

Wow, Very comprehensive article. I especially like the table of contents AND the links for each section. For me, that extra step is a pain but worth it. Great Job!

[Miguel Brito](https://hashnode.com/@miguendes)

[Nov 2, 2021](https://hashnode.com/posts/python-pathlib/617e57d8d55bde5cb6682432/comment/618008b0e0cb9449fc48d338#reply-6180f712b368d91070197e18)

Thanks [MCCurcio](https://hashnode.com/@MattCC), I really appreciate it.

This is a big piece and since it's meant to be a reference I wanted to make it easier for readers to jump around without reading it "from cover to cover".

It took me a while not only to write but to format the ToC but it's definitely worth it!
