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.

행과 열이 구분된 CSV 형태의 표 블록

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.