Show Menu
Cheatography

Some Python libraries Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

python­-ur­llib2

>>> import urllib2

>>> response = urllib­2.u­rlo­pen­("ht­tp:­//b­lah.co­m")
>>> html = respon­se.r­ead()
 

python - os library

import os
os.sys­tem­(<s­hel­l_c­omm­and­>)
os.lis­tdir()
os.pat­h.s­plit() # returns e.g. ("/s­ome­/pa­th",­"­fil­e.t­xt")
 

python - regex

<no. there is a cheatsheet on laptop for this, an rtfd or rtf>