March 2003
Intermediate to advanced
656 pages
39h 30m
English
ps1, ps2
ps1 and ps2 specify the primary
and secondary interpreter prompt strings, initially
'>>> ' and
'... ', respectively. These
attributes exist only in interactive interpreter sessions. If you
bind either attribute to a non-string object, Python prompts by
calling str( ) on the object each time a prompt is
output. This feature lets you create dynamic prompting by coding a
class that defines __str__ and assigning an
instance of that class to sys.ps1 and/or
sys.ps2.
Read now
Unlock full access