Website hosting service by

 Back to Index

3.12.1 Traceback Example

This simple example implements a basic read-eval-print loop, similar to (but less useful than) the standard Python interactive interpreter loop. For a more complete implementation of the interpreter loop, refer to the code module.


import sys, traceback

def run_user_code(envdir):
    source = raw_input(">>> ")
        exec source in envdir
        print "Exception in user code:"
        print '-'*60
        print '-'*60

envdir = {}
while 1:




2002-2004 Webhosting Service


Disclaimer: This documentation is provided only for the benefits of our hosting customers.
For authoritative source of the documentation, please refer to


Cheap domain registration : Register domain name or buy domain name, including free domain hosting services offers cheap domain registration, domain name transfer and domain search services    

Domain registration : Buy domain name or register domain name from $5.95/year only