Created
March 3, 2020 08:47
-
-
Save Sibirtsev/8b30e8d32f2b6a3d61223eabfc4c6f53 to your computer and use it in GitHub Desktop.
custom python prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PYTHONSTARTUP="$HOME/ipython.py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import sys | |
class IPythonPromptPS1(object): | |
def __init__(self): | |
self.line = 0 | |
def __str__(self): | |
self.line += 1 | |
return "\033[92mIn [%d]:\033[0m " % (self.line) | |
sys.ps1 = IPythonPromptPS1() | |
sys.ps2 = " \033[91m...\033[0m " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment