Intro to Python
Notes from Jaimie Murdock:
Assumes a start with Python 3.6. Python 2.7 is end of life in 2020, so new projects should avoid it.
PEPs (Python Enhancement Proposals) are how new features are added to the language and are very useful for learning why things are the way they are.
Some also offer style guidance.
- Coding style
- Lists, iterators, and generators
collections – especially
defaultdict, which helps avoid
KeyError issues when populating a collection
pickle – Python-native serialization. For export, better practice to use JSON via
json.dump(obj), but useful when in-memory objects take a long time to build.
- Script Management
- bottle –
pip install bottle – nanoframework, useful for quick mockups
- flask –
pip install flask – microframework
- Threading and Process Management
Useful non-stdlib modules