| Python Library Reference |
Thecode module provides facilities to implementread-eval-print loops in Python. Two classes and conveniencefunctions are included which can be used to build applications whichprovide an interactive interpreter prompt.
'__name__' set to'__console__'and key'__doc__' set toNone.sys.ps1 andsys.ps2, andinput buffering.source is the source string;filename is the optionalfilename from which source was read, defaulting to'<input>';andsymbol is the optional grammar start symbol, which shouldbe either'single' (the default) or'eval'.
Returns a code object (the same ascompile(source,filename,symbol)) if the command is complete andvalid;None if the command is incomplete; raisesSyntaxError if the command is complete and contains asyntax error, or raisesOverflowError orValueError if the command cotains an invalid literal.
| Python Library Reference |