Python

Learning Python

Python Environments

Python Environments: “venv (for Python 3) and virtualenv (for Python 2) allow you to manage separate package installations for different projects.”

Python Requirements.txt

To easily install program requirements on other computers, create a requirements.txt. Rather than manually installing program requirements, you could just run one command to install all program requirements with a requirements.txt

Why and How to make a Requirements.txt

Create a requirements.txt

$ pip freeze > requirements.txt

Use a requirements.txt

$ pip install -r requirements.txt

PyInstaller

Used to make executable files into standalone executable files. This is the preferred way to make python executables.

Note: the files are not 100% stand alone as they are still dependent on some core operating system libraries (for example, on linux to run the executable it’s dependent on glibc library).

To make a full standalone, you could create a pyinstaller executable then use CXFreeze.

CXFreeze

Deploying code to servers or other computers

Code

Journal