Python Ep 19: Organizing Code, Imports, and Refactoring a Monolith | Cybersecurity Masterclass
Joshua Moses | Cybertrace Foundation
0:00 / 0:00
Python Ep 19: Organizing Code, Imports, and Refactoring a Monolith | Cybersecurity Masterclass
10 просмотров · 2 нед. назад
Joshua Moses | Cybertrace Foundation
189 подписчиков
10 просмотров · 2 нед. назад
A messy single script is fine until it isn't. This episode looks at the breaking point where one file becomes too much, then walks through the tools Python gives you to fix it: modules, the different ways to import, packages and project structure, and what happens under the hood when Python finds, compiles, and runs an import. We look at the standard library as a built-in toolkit, then do a hands-on refactor in four phases, from a monolith script to utility functions, to a proper package, to a clean src layout, plus the common failures that bite people along the way.
CHAPTERS
0:00 Introduction
0:35 Why modular systems matter
1:08 Lesson roadmap
1:24 Outgrowing a single file
2:29 Modules and importing
3:07 Import variations
3:48 Packages and structure
4:41 How imports work under the hood
5:37 Why not write everything from scratch?
5:52 The standard library
6:39 Hands-on refactoring: monolith to project
6:46 The four refactoring phases
7:38 Common failures
8:23 Wrapping up
This episode is part of the Python programming series inside the Cybersecurity Masterclass. Python is the language security people reach for when they need to automate the boring stuff, parse logs, glue tools together, and build their own utilities, so every lesson here is a building block for that work. Watch the series in order for the best results, and drop your questions in the comments.
Cybersecurity Masterclass by Joshua Moses | CyberTrace Foundation. #Course Lab Guide:
https://github.com/joshuanmoses/Cyber...
https://github.com/joshuanmoses/Cyber...