Python Cheat
This repo is in the process of moving to: https://cirosantilli.com/linux-kernel-module-cheat#python
The move will be done progressively as examples are needed there, and no new content will be added here.
Python minimal examples. Asserts used wherever possible. Tested in Ubuntu 18.04.
Getting started
Introduction
Implementations
python utility
Style guides
Pros and cons
How to hack Python projects
Meta
test
Language
Functions
lambda
keyword-only argument
Built-in functions
class
Special methods
slots
issubclass
class
Exception
Decorator
Exception
Iterator
Data types
Built-in types
Number
dict
frozenset
list
set
String
format()
Format operator %
tuple
Multi-file operations : import, modules, imp
import_cheat
Operators
Python 3
Cross-language
C from Python
Python from C
py_from_c/eval.c
Pure embedding
pure.py
pure.c
py_from_c/test
Standard library
argparse
bisect
collections
curses
curses/collision.py
datetime
expat
fileinput
logging
math
optparse
os
environ
path
pickle
random
re
sqlite3
sys
tempfile
termcolor
time
tk
unittest
Networking
SimpleHTTPServer
smtplib
urllib2
wsgi
Multi-thread
subprocess
Multi threading hello world
Multi threading adder
Thread CPU bound vs IO bound
Limit the number of threads
concurrent
concurrent map
concurrent map exception
concurrent submit
Third party
Pexpect
pexpect/python_test.py
pip
sphinx
trac
urllib2
virtualenv
waf
wsgi
Scientific
NumPy
SciPy
SimPy
matplotlib . Moving to https://cirosantilli.com#matplotlib
jupyter
pandas
h5py HDF5
Interactive friendly
ipython
Packaging
distutils
setuptools
Bibliography
CONTRIBUTING