".>>>" is a good idea! (OT, was: Re: do you master list comprehensions?)

Kent Johnson kent3737 at yahoo.com
Thu Dec 16 15:05:11 EST 2004


Keith Dart wrote:
> What I do is set Python's sys.ps1 variable to something else. I have a 
> module called "interactive" that I import implicitly by shell alias:
> 
> py='python -i -c '\''import interactive'\'
> 
> Which, among other things, sets the prompt to "Python> "

You can do the same thing using a PYTHONSTARTUP file - see 
http://docs.python.org/tut/node4.html#SECTION004240000000000000000

You can change the prompts with
import sys
sys.ps1 = ' >>> '
sys.ps2 = ' ... '

Kent



More information about the Python-list mailing list