available in the built-in sys modulefrom sys exc_info(in additionpython' traceback module can be used to manually generate stack traces on your reply page for errorstracebacks show source-code lines active when an exception occurred we'll use this later in the error page in pymailcgi (add debugging prints you can always insert tracing print statements in your codejust as in normal python programs be sure you print the content-type header line firstthoughor your prints may not show up on the reply page in the worst caseyou can also generate debugging and trace messages by opening and writing to local text file on the serverprovided you access that file laterthis avoids having to format the trace messages according to html reply stream conventions run it live of courseonce your script is at least half workingyour best bet is likely to start running it live on the serverwith real inputs coming from browser running server locally on your machineas we're doing in this can help by making changes go faster as you test adding common input devices so farwe've been typing inputs into text fields html forms support handful of input controls (what we' call widgets in the traditional gui worldfor collecting user inputs let' look at cgi program that shows all the common input controls at once as usualwe define both an html file to lay out the form page and python cgi script to process its inputs and generate response the html file is presented in example - example - pp \internet\web\tutor html cgi common input devices please complete the following form and click send nameshoe sizesmall medium large occupationclimbing the cgi learning curve