Luka's web attic

about

Python - rulebook

Published:
Updated:

Fortunately or not, Python is unavoidable. So we need some rules to keep ourselves sane while using it.

XDG and home dir

First, let's remove the clutter:

Virtual environments

You must use virtual environments for all your python development. It is not optional.

$ python -m venv env
$ source env/bin/activate.fish # depending on the shell of choice
$ pip install number # e.g.
$ pip freeze > requirements.txt # to list all dependencies and their version into a file
$ pip install -r requirements.txt # to install all required dependencies

Note You should probably use uv.


This is it for today. I hope you find this article useful. As per usual, if you find any errors, or you want to comment on the article in some other way, you can reply via email.

Previous I'm feeling lucky! Next