Add cool utf-8 prompt to cpython interpreter

This commit is contained in:
Andrew R. M 2017-11-02 23:19:47 -04:00
parent 1d1cc96b3b
commit 4b810bb1a6

View File

@ -1,4 +1,5 @@
#{- ~/.pythonrc -}# #{- ~/.pythonrc -}#
# -*- coding: utf-8 -*-
import atexit import atexit
import os import os
@ -13,9 +14,9 @@ red = '\001\033[1;31m\002'
reset = '\001\033[0m\002' reset = '\001\033[0m\002'
# Primary prompt: (>>> ) in magenta # Primary prompt: (>>> ) in magenta
sys.ps1 = blue + '>' + reset + ' ' sys.ps1 = yellow + '○' + reset + ' '
# Secondary prompt: (... ) in red # Secondary prompt: (... ) in red
sys.ps2 = yellow + '.' + reset + ' ' sys.ps2 = blue + '•' + reset + ' '
# Use ~/.history/python as a history file instead of ~/.python_history # Use ~/.history/python as a history file instead of ~/.python_history
def custom_readline(): def custom_readline():