Skip to main content
AmigoFish

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.

Watch on YouTube

Not rated yet

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

Back to ArjanCodes ยท Report a problem

How to Write Python That Feels Like Python | ArjanCodes | AmigoFish