Skip to content

Instantly share code, notes, and snippets.

@Sibirtsev
Created March 3, 2020 08:47
Show Gist options
  • Save Sibirtsev/8b30e8d32f2b6a3d61223eabfc4c6f53 to your computer and use it in GitHub Desktop.
Save Sibirtsev/8b30e8d32f2b6a3d61223eabfc4c6f53 to your computer and use it in GitHub Desktop.
custom python prompt
export PYTHONSTARTUP="$HOME/ipython.py"
# -*- 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