-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython_profile.py
More file actions
25 lines (18 loc) · 821 Bytes
/
Copy pathpython_profile.py
File metadata and controls
25 lines (18 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Created by Andre Anjos <andre.dos.anjos@cern.ch>
# Qui 26 Jul 2007 11:04:58 CEST
# This my user initilization file. To get it activated
# whenever you start python, just make sure the environment
# variable PYTHONSTARTUP is defined to point to this file
import atexit
import os
import readline
import rlcompleter
histfile = os.path.expanduser("~/.python_history")
if os.path.exists(histfile): readline.read_history_file(histfile)
atexit.register(readline.write_history_file, histfile)
# adds some extra keyboard functions I like
readline.parse_and_bind('tab: complete')
#readline.parse_and_bind('bind ^I rl_complete') #does not work on mac python
readline.parse_and_bind('"\C-r": reverse-search-history')
readline.parse_and_bind('"\C-s": forward-search-history')
del os, atexit, readline, rlcompleter, histfile