Differences
This shows you the differences between two versions of the page.
python [2008/03/09 00:08] a updated |
python [2009/05/25 00:35] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Python ====== | ||
- | |||
- | see: **[[http:// | ||
- | |||
- | |||
- | ==== python interpreter (history + autocomplete) ==== | ||
- | |||
- | **'' | ||
- | # startup script for python to enable saving of interpreter history and | ||
- | # enabling name completion | ||
- | |||
- | # import needed modules | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | # where is history saved | ||
- | | ||
- | |||
- | # handler for saving history | ||
- | def save_history(historyPath=historyPath): | ||
- | | ||
- | | ||
- | |||
- | # read history, if it exists | ||
- | if os.path.exists(historyPath): | ||
- | | ||
- | |||
- | # register saving handler | ||
- | | ||
- | |||
- | # enable completion | ||
- | | ||
- | |||
- | # cleanup | ||
- | del os, atexit, readline, rlcompleter, | ||
- | |||
- | **'' | ||
- | export PYTHONSTARTUP=~/ | ||
- | |||
- | |||