root/env/.pyrc

Revision 3, 1.1 kB (checked in by devja..@anarkystic.com, 1 year ago)

sendin the env down the rivarr

Line 
1 # Add auto-completion and a stored history file of commands to your Python
2 # interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
3 # bound to the Esc key by default (you can change it - see readline docs).
4 #
5 # Store the file in ~/.pystartup, and set an environment variable to point to
6 # it, e.g. "export PYTHONSTARTUP=/max/home/itamar/.pystartup" in bash.
7 #
8 # Note that PYTHONSTARTUP does *not* expand "~", so you have to put in the full
9 # path to your home directory.
10
11 try:
12     import readline
13     import rlcompleter
14     import os
15     import atexit
16
17     historyPath = os.path.expanduser("~/.py_history")
18
19     def save_history(historyPath=historyPath):
20         import readline
21         readline.write_history_file(historyPath)
22
23     if os.path.exists(historyPath):
24         readline.read_history_file(historyPath)
25
26     atexit.register(save_history)
27     del os, atexit, readline, rlcompleter, save_history, historyPath
28     print '''Using readline'''
29 except ImportError:
30     print '''You should install readline... try: python `python -c "import pimp; print pimp.__file__"` -i readline'''
31
32
33 ls = "Dude, you just typed 'ls'"
34
Note: See TracBrowser for help on using the browser.