Category: Python

Python Tutorial / Distinguish Instance Attributes from Class Attributes
Locate instance and class state, observe attribute shadowing and reproduce then fix a mutable list accidentally shared across instances.

Python Tutorial / Group State and Behavior with Classes and Instances
Define a focused class, create independent instances and understand self, initialization and the limits of validation performed only at construction.

Python Tutorial / Read Tracebacks and Diagnose Problems with Debugging and Logging
Read Python tracebacks, inspect state with a debugger and use logging levels and channels to diagnose reproducible failures without leaking sensitive details.

Python Tutorial / Handle Exceptions with try, except, else, finally and raise
Trace exception-handling paths, raise explicit validation errors and distinguish recoverable input failures from defects that should remain visible.

Python Tutorial / Convert and Save JSON Data
Map JSON values to Python, save readable Unicode and distinguish valid JSON syntax from valid application data and strict numeric policies.

Python Tutorial / Read and Write CSV Files
Use csv.DictReader and DictWriter with quoting and newline handling, convert numeric values and define header, error-reporting and spreadsheet-export policies.

Python Tutorial / Read and Write Text Files with with and Encodings
Select text-file modes and encodings, manage file lifetime with with and protect existing data while handling path, permission and decoding errors.

Python Tutorial / Manage File and Folder Paths with pathlib
Build paths with pathlib, distinguish working directories from script locations and inspect files without assuming existence checks guarantee safe access.

Python Tutorial / Organize Packages and Define a Safe Entry Point
Create a regular package, run it with python -m and verify that importing its entry module does not accidentally start the application.

Python Tutorial / Create Modules and Split Code with import
Split a Python application into reusable modules, understand import lookup and initialization, and avoid shadowing, side effects and circular dependencies.