Curated list of useful resources and cheatsheets for web developers
View the Project on GitHub zlatanstajic/ultimate-cheatsheet-for-developers
Python programming language and package management.
Read more about Python.
# Show Python version
python3 --version
# Change global python version (Ubuntu/Debian)
sudo update-alternatives --config python3
# Show path of active Python interpreter
which python3
# Create a virtual environment in the current directory
python3 -m venv [env-name]
# Activate virtual environment (Linux/macOS)
source [env-name]/bin/activate
# Activate virtual environment (Windows)
[env-name]\Scripts\activate
# Deactivate virtual environment
deactivate
# Remove virtual environment
rm -rf [env-name]
# Upgrade pip itself
python3 -m pip install --upgrade pip
# Install a package
pip install [package-name]
# Install a specific version
pip install [package-name]==[version]
# Install from requirements file
pip install -r requirements.txt
# List installed packages
pip list
# List outdated packages
pip list --outdated
# Freeze installed packages to a requirements file
pip freeze > requirements.txt
# Uninstall a package
pip uninstall [package-name]
# Show package details
pip show [package-name]
# Check CSV validity
pip install csvkit
csvstat [file-path].csv
# Run a simple HTTP server (serves current directory on port 8000)
python3 -m http.server 8000
# Pretty-print a JSON file
python3 -m json.tool [file.json]