How to Write Python That Feels Like Python
From ArjanCodes ยท ยท 26 min

The player loads from YouTube only when you click. It uses YouTube's privacy-enhanced mode.
If the video does not play, the owner may have turned off embedding. Watch it on YouTube instead.
Description
๐ก Learn how to design great software in 7 steps: https://arjan.codes/designguide.
What does it actually mean to write *Pythonic* code? In this video, we answer that question by taking a small, messy script and refactoring it step by step using the core principles of idiomatic Python. Along the way, youโll learn how to think like a Pythonista: using functions instead of unnecessary classes, leveraging dataclasses, writing readable control flow, embracing tools like pathlib and logging, and applying the Zen of Python in practice.
๐๏ธ Check out ArjanCodes merch: https://shop.arjancodes.com.
๐ฅ GitHub Repository: https://git.arjan.codes/2025/pythonic.
๐ ArjanCodes Courses: https://www.arjancodes.com/courses.
๐ฌ Join my Discord server: https://discord.arjan.codes.
โจ๏ธ Keyboard Iโm using: https://amzn.to/49YM97v.
๐ Chapters: 0:00 Intro 0:18 What does Pythonic mean? 2:08 Before 3:13 Step 1 โ Prefer Functions Over Classes 4:32 Step 2 โ Use Context Managers 6:42 Step 3 โ Add Type Annotations 10:46 Step 4 โ Favor EAFP Over LBYL 12:06 Step 5 โ Use Dataclasses for Structured Data 17:09 Step 6 โ Centralize File Paths and Use 19:19 Step 7: Rely on Python's strengths 23:10 Step 8 โ Add Logging Instead of Print 24:10 Step 9 โ Add a Main Function 25:56 Final Thoughts
#arjancodes #softwaredesign #python