Python3 Notes

A couple of notes for myself and anyone interested.

Create a Virtual environment

python3 -m venv /path/to/new/virtual/environment

Install pip

You use ensurepip module

python -m ensurepip

Run a module in a secure way

To run a module, you don't only need to specify -m, you also want to specify I as well. Without that, python adds the current directory to sys.path - thus opening the door for a preload attack.