Notes on Python
pip
Install packages per user
$ pip install --user <package>
In previous versions of pip you had to use
$ pip install --install-option="--user" <package>
$ sudo pip-python install --install-option="--prefix=/usr/local" <package>
Install/upgrade directly from GitHub, example with pysweng (see also):
$ pip install --user git+https://github.com/lopezpdvn/pysweng@dev#egg=pysweng
$ pip install --user --upgrade git+https://github.com/lopezpdvn/pysweng@dev#egg=pysweng
virtualenv
$ cd $PROJ_REPO_ROOT
$ virtualenv -p $PYTHON_EXE .
JSON
Python interpreter JSON command line tool
$ python3 -m json.tool <path to json file>
$ python3 -c "import sys, json; json.dump(json.load(sys.stdin), sys.stdout, indent=2, separators=(',', ':'))" < ugly.json > pretty.json
Templates
Sample project template
Python Packaging Authority sample project.
Short script
Short script template