← Back to Main | Web Study Repository
This directory contains Python programming language study materials, sample applications, and framework implementations. Python is a high-level, interpreted programming language known for its simplicity, readability, and extensive ecosystem of libraries and frameworks.
- Django: High-level Python web framework for rapid development
- Production-ready Django project with REST API, Docker support, and best practices
- Flask: Lightweight WSGI web application framework
- Flask web application examples and utilities
- Samples: Core Python language examples and applications
- Django web applications and models
- Lambda function implementations
- Server implementations
- Load Testing: Locust load testing samples for concurrent user testing
- Queue Processing: Queue processing samples with MongoDB and PostgreSQL
- File I/O and data processing utilities
- Web scraping and automation scripts
- Python 3.8 or higher
- pip (Python package installer)
- Virtual environment tool (venv or virtualenv)
-
Install Python
# On Ubuntu/Debian sudo apt update sudo apt install python3 python3-pip python3-venv # On macOS with Homebrew brew install python3 # On Windows, download from python.org # Verify installation python3 --version pip3 --version
-
Create Virtual Environment
cd python python3 -m venv venv # Activate virtual environment # On Linux/macOS: source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies
# For Django framework cd django pip install -r requirements.txt # For Flask framework cd flask pip install flask # For web scraping pip install requests beautifulsoup4
cd python/django
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 manage.py migrate
python3 manage.py runservercd python/samples
python3 manage.py runserver # For Django applications
python3 main.py # For standalone scriptscd python/flask
export FLASK_APP=app.py
flask runEach sample in the samples/ directory can be run independently:
# Run a specific Python file
python3 samples/first.py
# Run Django development server
cd samples
python3 manage.py runserverNavigate to the Flask project directory:
cd python/flask
python3 app.py
# Or use Flask CLI
export FLASK_APP=app.py
flask run --debugpython/
├── README.md # This file
├── django/ # Django framework (production-ready)
│ ├── config/ # Project configuration
│ ├── core/ # Main application
│ ├── templates/ # HTML templates
│ ├── static/ # Static files
│ ├── requirements.txt # Python dependencies
│ ├── Dockerfile # Docker configuration
│ ├── docker-compose.yml # Multi-container setup
│ └── README.md # Django-specific documentation
├── samples/ # Pure Python language examples
│ ├── __init__.py # Python package marker
│ ├── admin.py # Django admin configuration
│ ├── apps.py # Django app configuration
│ ├── brython_startreck.html # Brython JavaScript bridge example
│ ├── db.sqlite3 # Sample SQLite database
│ ├── first.py # Basic Python examples
│ ├── lambda/ # AWS Lambda function examples
│ ├── main.py # Main application entry point
│ ├── manage.py # Django management script
│ ├── minimal_server.py # Simple HTTP server
│ ├── models.py # Django data models
│ ├── tests.py # Unit tests
│ └── views.py # Django views
└── flask/ # Flask framework examples
└── [Flask applications] # Flask-specific implementations
- Core Python Concepts: Data types, control structures, functions, classes
- Web Development: Django framework, Flask microframework, REST APIs
- Data Processing: File I/O, JSON/XML parsing, data manipulation
- Database Integration: SQLite, ORM patterns, database migrations
- Testing: Unit testing, test-driven development
- Cloud Integration: AWS Lambda functions, serverless architecture
- Web Scraping: HTTP requests, HTML parsing, automation
- Code Style: Follow PEP 8 Python style guidelines
- Documentation: Include docstrings for functions and classes
- Testing: Write unit tests using unittest or pytest
- Dependencies: Use requirements.txt for dependency management
- Virtual Environments: Always use virtual environments for projects
- Place pure Python examples in the
samples/directory - Add framework-specific examples in appropriate subdirectories under their framework folder
- Update this README with new content descriptions
- Include requirements.txt for any external dependencies
- Use meaningful variable and function names
- Include type hints where appropriate
- Follow the Zen of Python principles
- Write clean, readable code with appropriate comments
- Handle exceptions properly
- Official Python Documentation
- Django Documentation
- Flask Documentation
- PEP 8 Style Guide
- Python Package Index (PyPI)
- Real Python Tutorials
- Python.org Tutorial
- Python AI Course - Comprehensive Python AI/ML course materials
- Python Study - Additional Python study materials and examples