General Python Info
Dive Into Python book
From Guido van Rossum's Python Tutorial: "By the way, the language is named after the BBC show Monty Python's Flying Circus and has nothing to do with nasty reptiles. Making references to Monty Python skits in documentation is not only allowed, it is encouraged!"
IPython an improved interactive python shell.
One Laptop Per Child Python environment: The OLPC's user interface (Sugar) and many of its applications are written in Python.
Location of site-packages on a Debian-based system (like Ubuntu):
Python documentation is written in reStructuredText
- PEP 20: The Zen of Python
- PEP 8: Style Guide for Python Code
- PEP 257: Docstring Conventions
- PEP 287: reStructuredText Docstring Format
Tools for Python Development
- virtualenv for running python programs in isolated environment with a particular version of python and particular available packages.
- sphinx a documentation generator. The official Python and Django documentation pages are done with Sphinx. The text is written in a stylized form of plain text known as ReStructuredText. See:A ReStructuredText Primer and Quick reStructuredText.
- trac issue tracking and wiki. For configuration with WSGI: TracModWSGI
- fabric "simple pythonic deployment"; deploying web applications to servers and automating other remote tasks. See the fabric tutorial.
- pip python package installer
search path for loading modules
To see the current search path for loading modules:
import sys sys.path
to set the path in the shell so that it is available for a regular python command window
BUT this does not work for IDLE.
To add to that path, set the environment variable PYTHONPATH, such as (with a bash shell):
or multiple directories separated by colons, and $HOME refers to the user's home directory:
in the case where PYTHONPATH is already set and you just want to add to it:
The new path can be seen by:
or to see just PYTHONPATH:
export | grep PYTHONPATH
inside IDLE or inside any python command window
sys.path is a list of strings
to add to the front:
import sys sys.path.insert(0,"/path/to/wherever")
to add to the end: