Official Python Resources
- The Python Standard Library
- [[main — Top-level code environment]]
- On
sys.exit(main())
: “Since the call tomain
is wrapped insys.exit()
, the expectation is that your function will return some value acceptable as an input tosys.exit()
; typically, an integer orNone
(which is implicitly returned if your function does not have a return statement).” - “
__main__.py
will be executed when the package itself is invoked directly from the command line using the-m
flag.”. Example:python -m bandclass
- You can
import __main__
to do useful things likething in dir(__main__)
checks. There’s special handling in the import system as described in Special considerations for main
- On
- contextlib — Utilities for with-statement contexts
- [[main — Top-level code environment]]
- The Python Language Reference
- ✨ 3. Data model - the Python data model methods as referred to by James Powell a.k.a. Don’t Use This Code
- Python HOWTOs
- Functional Programming HOWTO
- Socket Programming HOWTO
- Logging HOWTO - When to use logging - Python Docs - specifically the section on When to use logging since this table is very clear and useful
- The Python Tutorial - the official Python 3 tutorialbeginnerfriendly - under this point I include non-trivial standard library modules (i.e. packages or modules like
json
csv
respectively are omitted as I use them so frequently, so am familiar with them)-
- The module
pickletools
contains tools for analyzing data streams generated bypickle
.pickletools
source code has extensive comments about opcodes used by pickle protocols.
- The module
- Data Compression: Common data archiving and compression formats are directly supported by modules including
zlib
,gzip
,bz2
,lzma
,zipfile
andtarfile
- The
email
package is a library for managing email messages, including MIME and other RFC 2822-based message documents. Unlikesmtplib
andpoplib
which actually send and receive messages, the email package has a complete toolset for building or decoding complex message structures (including attachments) and for implementing internet encoding and header protocols. - The
smtplib
module defines an SMTP client session object that can be used to send mail to any internet machine with an SMTP or ESMTP listener daemon. - XML processing is supported by the
xml.etree.ElementTree
,xml.dom
andxml.sax
packages. Together, these modules and packages greatly simplify data interchange between Python applications and other tools. - The
sqlite3
module is a wrapper for the SQLite database library, providing a persistent database that can be updated and accessed using slightly nonstandard SQL syntax. - Internationalization is supported by a number of modules including
gettext
,locale
, and thecodecs
package. - 11. Brief Tour of the Standard Library — Part II
-
- Python/C API Reference Manual
3rd Party Python Resources
- Dive Into Python 3 - IMHO the best place to start learning Pythonbeginnerfriendly
- Python Data Science Handbook by Jake VanderPlas - helped me a lot when I was starting outbeginnerfriendly
- A Whirlwind Tour of Python - Jake VanderPlas -beginnerfriendly
- The Hitchhiker’s Guide to Python -beginnerfriendly
- Intermediate Python
- Hyperpolyglot Numerical Analysis & Statistics: MATLAB, R, NumPy, Julia - a side-by-side reference sheet
- Python Object Graphs — objgraph 3.6.2 documentation
- [[Why you should use
python -m pip
]] - not sure about this but saved for reference/to check later - What Are Python Wheels and Why Should You Care?
- pip documentation
- Python Packaging User Guide
- Learning Resources for pytest The PyCharm Blog - pytest
- File IO With Memory Mapping Using Python mmap - Real Python
PEPs
Interesting or useful PEPs.
Articles
- CHARMING PYTHON B26 Python Elegance, Python Warts, Part 2 — Properties, attributes, methods and custom access — - recommended in Dive Into Python 3
- 🔥 Read Inside The Python Virtual Machine this looks absolutely amazing; added to READUS
- Polars vs. pandas What’s the Difference? The PyCharm Blog
- Python’s new t-strings - davepeck.org
- Python Closures Common Use Cases and Examples
- Use Ruff, Pyright, typos, and gitlint to Help You Write Better Python Code (Python Linting) - YouTube
Packages (useful to remember)
- Introduction Pyrefly
- Pyre Pyre || facebook/pyre-check
- Beartype - Beartype enforces type hints across your entire app in two lines of runtime code with no runtime overhead
- pipx — Install and Run Python Applications in Isolated Environments
- pipx - main (first) docs page
- psutil: giampaolopsutil Cross-platform lib for process and system monitoring in Python
- Polars: Index - Polars user guide
- dill package documentation — dill 0.4.1.dev0 documentation
- SciPy