Disclaimer: You are looking at a post I wrote some time ago. The information and opinions contained within may be outdated and may differ from my current views. Please proceed accordingly.

Python Prompt

Oct 23, 2002 4:13 PM
Tags: python, unix
Random Python tip:
Want a better prompt? Put this in a file called ~/.pythonrc.py:
import rlcompleter, readline, sys
readline.parse_and_bind('tab: complete')

class Prompt:
  def __init__(self, str='>>>'):
    self.str = str;
        
  def __str__(self):
    return self.str
    
sys.ps1 = Prompt("\033[1;34m>>> \033[0m")

That will give you tab-completion, Unix style, and a blue-colored prompt.

Comments: Python Prompt

Cool.

Posted by: Japhy on May 9, 2008 11:19 PM | permalink

No more comments! Either someone has violated Godwin's Law, I'm tired of the discussion or, most likely, the ten-week window has closed. You can, however, contact me through email.