Skip to content

Instantly share code, notes, and snippets.

@jbhanks
Forked from jookyboi/python_resources.md
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save jbhanks/0a3d9995360b1091d817 to your computer and use it in GitHub Desktop.

Select an option

Save jbhanks/0a3d9995360b1091d817 to your computer and use it in GitHub Desktop.
Python-related modules and guides.
# from stackexchange
#You are looking for the Cartesian Product.
#In mathematics, a Cartesian product (or product set) is the direct product of two sets.
#In your case, this would be {1, 2, 3, 4, 5, 6} x {1, 2, 3, 4, 5, 6}. itertools can help you there:
import itertools
x = [1, 2, 3, 4, 5, 6]
[p for p in itertools.product(x, repeat=2)]
#result
[(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (2, 1), (2, 2), (2, 3),
(2, 4), (2, 5), (2, 6), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6),
(4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6), (5, 1), (5, 2), (5, 3),
(5, 4), (5, 5), (5, 6), (6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (6, 6)]

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

  • The Django Book - A free book about the Django Web framework for the Python programming language.
  • The Hitchhiker's Guide to Python - This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment