# Python 基础学习 **Repository Path**: shuaishuang/python-basics ## Basic Information - **Project Name**: Python 基础学习 - **Description**: Python 语法入门、基础练习 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-07-16 - **Last Updated**: 2026-07-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Python Basics Learning Project This is a Python fundamentals learning and practice project containing practical code for core concepts such as class design and file operations. ## Project Structure ``` python-basics/ ├── 2026_Summer_practice/ # 2026 Summer Python Practice Manual │ ├── docs/ # MkDocs documentation directory │ │ ├── css/custom.css # Custom styles │ │ └── index.md # Documentation homepage │ ├── mkdocs.yml # MkDocs configuration file │ └── init_project.py # Project initialization script │ ├── class_demo/ # Python class definition demonstrations │ ├── class_demo_pra.py # Basic class exercise (Student class) │ ├── class_inherit_pra.py # Class inheritance exercise (Employee class) │ ├── shopping_list.py # Shopping list class implementation │ └── test_shopping_list.py # Shopping list unit tests │ └── file_operate_practice/ # File operation practice ├── data/ # Data files directory │ ├── data.json │ ├── result.txt │ ├── scores.json │ └── students.json └── src/ # Source code directory ├── __init__.py ├── path_config.py ├── pra_1.py └── pra_2.py ``` ## Content Overview ### Class Definition and Object-Oriented Programming - **Student Class**: Demonstrates a student class with functionality for setting and printing grades. - **Employee Class**: An employee class with subclasses (FullTimeEmployee, PartTimeEmployee) illustrating inheritance and polymorphism. - **ShoppingList Class**: Implements a shopping list class with item counting and total price calculation. ### File Operations - Reading and writing JSON files - Student information management - Grade data processing - Path configuration management ## Getting Started ### Prerequisites - Python 3.7+ ### Running Examples ```bash # Navigate to the class demonstration directory cd class_demo # Run the student class demo python class_demo_pra.py # Run the employee class inheritance demo python class_inherit_pra.py # Run the shopping list and view test results python -m unittest test_shopping_list # Navigate to the file operation practice directory cd file_operate_practice/src # Run file operation exercises python pra_1.py python pra_2.py ``` ## Viewing Documentation This project uses MkDocs to generate documentation: ```bash # Navigate to the documentation directory cd 2026_Summer_practice # Preview documentation locally mkdocs serve ``` ## Learning Objectives Through this project, you will learn: 1. Defining and using Python classes 2. The three core principles of object-oriented programming: encapsulation, inheritance, and polymorphism 3. Python file operations (JSON, TXT) 4. Basics of unit testing 5. Directory and path handling ## Contributions Issues and pull requests are welcome!