<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/sources/coreyms/best-of/2024" -->

---
title: Best Corey Schafer posts of 2024 | daily.dev
description: The most upvoted Corey Schafer posts of 2024, curated by the daily.dev community.
canonical: https://daily.dev/sources/coreyms/best-of/2024
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:url: https://daily.dev/sources/coreyms/best-of/2024
og:type: website
og:site_name: daily.dev
og:title: Best Corey Schafer posts of 2024 | daily.dev
og:description: The most upvoted Corey Schafer posts of 2024, curated by the daily.dev community.
og:image: https://media.daily.dev/image/upload/s--VAY5ToZt--/f_auto/v1724209435/public/daily.dev%20-%20open%20graph
---

# Best of Corey Schafer — 2024

1. 1  
[](/posts/python-tutorial-pathlib---the-modern-way-to-handle-file-paths-uqj8gsv7a "Python Tutorial: Pathlib - The Modern Way to Handle File Paths")  
Video  
[![coreyms's profile](https://media.daily.dev/image/upload/s--ACi7CG1x--/f_auto/v1716024677/logos/coreyms)](/sources/[source]/best-of/[year])  
34m watch time • Sep 23, 2024  
### Python Tutorial: Pathlib - The Modern Way to Handle File Paths  
Learn about Python's pathlib module introduced in Python 3.4, a modern alternative to the OS module for handling file paths. Pathlib represents paths as objects, making file operations more intuitive and less error-prone across different operating systems. The tutorial provides practical examples and contrasts the usage of pathlib versus the OS module, explaining the benefits of switching to pathlib for better readability and efficiency. Additionally, the tutorial covers pathlib's methods for creating, deleting, and modifying files and directories, with guidance on when to use the OS or shutil modules instead.

+2  
![Post Cover image](https://i.ytimg.com/vi/yxa-DJuuTBI/sddefault.jpg)  
30

[See all Corey Schafer archives](/sources/coreyms/best-of)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://daily.dev/sources/coreyms/best-of/2024#page","url":"https://daily.dev/sources/coreyms/best-of/2024","name":"Best Corey Schafer Posts of 2024","description":"The most upvoted Corey Schafer posts of 2024, curated by the daily.dev community.","isPartOf":{"@type":"WebSite","url":"https://daily.dev"}},{"@type":"ItemList","@id":"https://daily.dev/sources/coreyms/best-of/2024#items","numberOfItems":1,"itemListElement":[{"@type":"ListItem","position":1,"url":"https://daily.dev/posts/python-tutorial-pathlib---the-modern-way-to-handle-file-paths-uqj8gsv7a","name":"Python Tutorial: Pathlib - The Modern Way to Handle File Paths"}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sources","item":"https://daily.dev/sources"},{"@type":"ListItem","position":3,"name":"Corey Schafer","item":"https://daily.dev/sources/coreyms"},{"@type":"ListItem","position":4,"name":"Best of","item":"https://daily.dev/sources/coreyms/best-of"},{"@type":"ListItem","position":5,"name":"2024"}]}]}
```

