stdin input streamalong with shell environment variables output is sent back from the server to the client by simply printing properly formatted html to the stdout output stream the most complex parts of this scheme include parsing all the input information sent up from the browser and formatting information in the reply sent back happilypython' standard library largely automates both tasksinput with the python cgi moduleinput typed into web browser form or appended to url string shows up as values in dictionary-like object in python cgi scripts python parses the data itself and gives us an object with one key value pair per input sent by the browser that is fully independent of transmission style (roughlyby fill-in form or by direct urloutput the cgi module also has tools for automatically escaping strings so that they are legal to use in html ( replacing embedded and characters with html escape codesmodule urllib parse provides additional tools for formatting text inserted into generated url strings ( adding %xx and escapeswe'll study both of these interfaces in detail later in this for nowkeep in mind that although any language can be used to write cgi scriptspython' standard modules and language attributes make it snap perhaps less happilycgi scripts are also intimately tied to the syntax of htmlsince they must generate it to create reply page in factit can be said that python cgi scripts embed htmlwhich is an entirely distinct language in its own right as we'll also seethe fact that cgi scripts create user interface by printing html syntax means that we have to take special care with the text we insert into web page' code ( escaping html operatorsworsecgi scripts require at least cursory knowledge of html formssince that is where the inputs and target script' address are typically specified this book won' teach html in depthif you find yourself puzzled by some of the arcane syntax of the html generated by scripts hereyou should glance at an html introductionsuch as html xhtmlthe definitive guide also keep in mind that higher-level tools and frameworks can sometimes hide the details of html generation from python programmersalbeit at the cost of any new complexity inherent in the interestinglyin we briefly introduced other systems that take the opposite route--embedding python code or calls in html the server-side templating languages in zopepspand other web frameworks use this modelrunning the embedded python code to produce part of reply page because python is embeddedthese systems must run special servers to evaluate the embedded tags because python cgi scripts embed html in python insteadthey can be run as standalone programs directlythough they must be launched by cgi-capable web server what' server-side cgi script