18 lines
491 B
Plaintext
18 lines
491 B
Plaintext
#{- ~/.pythonrc -}#
|
|
|
|
import atexit
|
|
import os
|
|
import readline
|
|
import sys
|
|
|
|
# Primary prompt: (>>> ) in magenta
|
|
sys.ps1 = '\033[1;35m>>>\033[0m '
|
|
# Secondary prompt: (... ) in red
|
|
sys.ps2 = '\033[1;31m...\033[0m '
|
|
|
|
# Use ~/.history/python as a history file instead of ~/.python_history
|
|
history_file = os.path.join (os.environ['HOME'], '.history', 'python')
|
|
if os.path.exists(history_file):
|
|
readline.read_history_file(history_file)
|
|
atexit.register(readline.write_history_file, history_file)
|