to handle form (and otherrequestsexample - implements python cgi script that fetches and updates our shelve' records it echoes back page similar to that produced by example - but with the form fields filled in from the attributes of actual class objects in the shelve database as in the guithe same web page is used for both displaying results and inputting updates unlike the guithis script is run anew for each step of user interactionand it reopens the database each time (the reply page' action field provides link back to the script for the next requestthe basic cgi model provides no automatic memory from page to pageso we have to start from scratch each time example - pp \preview\cgi-bin\peoplecgi py ""implement web-based interface for viewing and updating class instances stored in shelvethe shelve lives on server (same machine if localhost""import cgishelvesysos shelvename 'class-shelvefieldnames ('name''age''job''pay'cgi test(dumps inputs shelve files are in cwd form cgi fieldstorage(print('content-typetext/html'sys path insert( os getcwd()parse form data hdrblank line is in replyhtml so this and pickler find person main html template replyhtml ""people input form key $rows""insert html for data rows at $rowsrowhtml '% \nrowshtml 'for fieldname in fieldnamesrowshtml +(rowhtml ((fieldname, )step adding web interface