Python cheatsheet
The friendliest programming language for automation and security
How it works
- Write — Put your instructions in a .py file.
- Run — The Python interpreter executes it line by line.
- Import — Reuse modules such as hashlib, re and csv.
- Automate — Turn a boring 1-hour job into a 1-second script.
First steps
python3 --version- Check the installed version
python3 -m venv .venv- Create a clean project environment
python3 -c "print('Hello')"- Run one line
python3 -m pip list- See installed packages