This repository contains exercises and example files created while following the Udemy course "Python 3 - Do Zero ao Avançado" (https://www.udemy.com/course/python-3-do-zero-ao-avancado).
The files here are practice code for learning Python concepts and standard library usage. The code is organized across many lesson files (e.g. aulaXX.py) and small folders with specific examples.
This README gives a short overview and instructions to run examples locally.
- Python basics: variables, control flow, functions, list/dict/set operations
- Data structures: lists, tuples, sets, dictionaries
- File I/O and CSV/JSON handling
- Functions:
*args,**kwargs, lambda, closures - Object-oriented programming: classes,
__init__,__repr__,__str__,__new__, properties (@property), setters - Decorators and higher-order functions
- Generators and
yield - Iterators and implementing sequence/iterator protocols
- Error handling and
try/except - Modules and packages
- Virtual environments (venv) and dependency management
- Working with OS:
os,shutil, path manipulation - Docker Compose and using MySQL inside Docker for development
- Advanced topics touched: abstract base classes, metaclasses (overview),
__call__behavior
aula*.py— lesson files, many small scripts demonstrating individual topicsmodulo4/— examples for functions, lambda, closures, etc.aula161.py— example implementing a simple custom sequence/iteratoraula173.py— file/OS examples usingosandshutilaula206/— contains adocker-compose.ymland examples that use a MySQL container for exercisesrequirements.txt— Python dependencies (if present)
- Create and activate a virtual environment (recommended):
python -m venv venv
.\venv\Scripts\Activate.ps1- Install dependencies (if
requirements.txtexists):
pip install -r requirements.txt- Run a lesson script directly:
python aula82.py- Docker (for
aula206MySQL example):
Start containers (in aula206 folder):
cd aula206
docker-compose up -dStop containers:
docker-compose downIf the MySQL container reports InnoDB errors at startup, you may need to remove the mysql_206 data directory inside the aula206 folder to recreate a clean database (this will delete any stored data):
docker-compose down
Remove-Item -Recurse -Force .\mysql_206
docker-compose up -dSome scripts use environment variables to connect to the DB. You can set them in PowerShell before running the script:
$env:MYSQL_HOST = '127.0.0.1'
$env:MYSQL_PORT = '3306'
$env:MYSQL_USER = 'root'
$env:MYSQL_PASSWORD = 'your_password'
$env:MYSQL_DATABASE = 'your_database'
python main.pyNote: MySQL 8 uses caching_sha2_password authentication by default. If a Python client library requires it, install the cryptography package:
pip install cryptographyAlso in some GUI clients (like DBeaver) you may need to enable allowPublicKeyRetrieval=true in the driver properties.
Some files include automatically-generated docstring skeletons. Replace placeholder sections like _summary_, _type_ and _description_ with real descriptions for better documentation. Consider using linting and formatting tools (e.g. flake8, black) to keep the code consistent.
This repository is a personal learning workspace with many small example files. Use it as a study reference. If you want to keep changes or share improvements, it's recommended to add tests or small README notes per folder describing the exercise intent.