PY Python

Python: Running Code & Tools

Running Python

python my_script.py
python3 my_script.py       # on Linux/macOS
python -i my_script.py      # run then enter interactive mode

Type python (or python3) with no file to start the interactive REPL — a good way to experiment with short code.

Editors and IDEs

  • VS Code — install the Python extension by Microsoft. Provides IntelliSense, debugging, linting.
  • PyCharm — full-featured Python IDE by JetBrains (free Community edition)
  • Thonny — simple editor aimed at beginners
  • IDLE — comes with Python, minimal but functional

Package management with pip

pip install requests          # install a package
pip install --upgrade pip     # upgrade pip itself
pip list                      # list installed packages
pip freeze > requirements.txt # save dependencies

Quick check below!