Skip to content

Instantly share code, notes, and snippets.

@npodonnell
Last active October 19, 2020 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save npodonnell/97f138f4e6010f468440aff88450239d to your computer and use it in GitHub Desktop.
Save npodonnell/97f138f4e6010f468440aff88450239d to your computer and use it in GitHub Desktop.

Python Cheatsheet

N. P. O'Donnell, 2020

Virtual Environments

Create venv:

virtualenv -p python venv

Start it:

source venv/bin/activate

To quit venv:

deactivate

Destroy it:

rm -fr ./venv

Find out if you're currently in a venv:

python -c 'import sys; print(sys.prefix != sys.base_prefix)'

Pip

Install from requirements.txt file:

pip install -r ./requirements.txt

Tox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment