This is an old revision of the document!
Python
Recommended packages:
pipenv | installs packages in a virtual python environment and maintains a Pipfile with all requirements |
---|
Requirements / Dependencies
- pip
- venv
- pip-tools
- pyenv
- conda
- pipenv
- poetry
- Docker
Articles
Shebang
Has to be on the first line of every executable script so the interpreter can be found. Correct Shebang for Python 3 is:
#!/usr/bin/env python3
Troubleshooting
/usr/bin/env: 'python3\r': No such file or directory
Line endings are in Windows format (CRLF
/ \r\n
) and not Linux/Unix format (LF
/ \n
). Fix this with dos2unix
or your text editor's save options.
Types
- mypy is an optional type checker for Python
- Python: better typed than you think – mypy assisted error handling, exception mechanisms in other languages, fun with pattern matching and type variance (Dima Gerasimov, 2019)
- Our journey to type checking 4 million lines of Python (Dropbox, 2019)
- Applying mypy to real world projects – Some hints and tips for getting started with Mypy and introducing it to existing projects (Cal Paterson, 2020)
Libraries
web frameworks
dos and don'ts
what you should NOT do with Python
cool projects made with Python
- youtube-dl – download videos from portals like youtube, vimeo, bitchute and lots of others
- can also be paired well with the mpv video player (not written in Python)
- Py Terminal Media Viewer – utf-8/truecolor image and video viewer for the terminal
- Home Assistant – home automation
- Ansible – DevOps