highlight few new coding tricks worth notingespecially regarding cgi script debugging and security let' take quick look converting strings in cgi scripts just for funthe script echoes back the name of the server platform by fetching sys platform along with the square of the age input field notice that the age input' value must be converted to an integer with the built-in int functionin the cgi worldall inputs arrive as strings we could also convert to an integer with the built-in eval function conversion (and othererrors are trapped gracefully in try statement to yield an error lineinstead of letting our script die but you should never use eval to convert strings that were sent over the internetlike the age field in this exampleunless you can be absolutely sure that the string does not contain even potentially malicious code for instanceif this example were available on the general internetit' not impossible that someone could type value into the age field (or append an age parameter to the urlwith value that invokes system shell command given the appropriate context and process permissionswhen passed to evalsuch string might delete all the files in your server script directoryor worseunless you run cgi scripts in processes with limited permissions and machine accessstrings read off the web can be dangerous to run as code in cgi scripting you should never pass them to dynamic coding tools like eval and execor to tools that run arbitrary shell commands such as os popen and os systemunless you can be sure that they are safe always use simpler tools for numeric conversion like int and floatwhich recognize only numbersnot arbitrary python code debugging cgi scripts errors happeneven in the brave new world of the internet generally speakingdebugging cgi scripts can be much more difficult than debugging programs that run on your local machine not only do errors occur on remote machinebut scripts generally won' run without the context implied by the cgi model the script in example - demonstrates the following two common debugging trickserror message trapping this script assigns sys stderr to sys stdout so that python error messages wind up being displayed in the response page in the browser normallypython error messages are written to stderrwhich generally causes them to show up in the web server' console window or logfile to route them to the browserwe must make stderr reference the same file object as stdout (which is connected to the browser in cgi scriptsif we don' do this assignmentpython errorsincluding program errors in our scriptnever show up in the browser climbing the cgi learning curve