← Back In the print window choose “Save as PDF” as the printer.

Python cheatsheet

The friendliest programming language for automation and security

UnixDroid

How it works

  1. Write — Put your instructions in a .py file.
  2. Run — The Python interpreter executes it line by line.
  3. Import — Reuse modules such as hashlib, re and csv.
  4. 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
Install packages only from trusted names — fake look-alike packages exist. Practise only on your own computer, your own network or a lab that gives you permission. Using security tools on systems that are not yours can be a crime (in India under the IT Act).