urllib parse quote_plus("there' bugger all down here on earth"'there% +bugger+all+down+here+on+earththe module commonhtmlthoughcalls the higher-level urllib parse urlencode functionwhich translates dictionary of name:value pairs into complete url query parameter stringready to add after marker in url for instancehere is urlencode in action at the interactive promptparmdict {'user''brian''pswd''#!/spam''text''say no moresquire!'urllib parse urlencode(parmdict'text=say+no+more% +squire% &pswd=% % % fspam&user=brian"% ?% ("'internallyurlencode passes each name and value in the dictionary to the built-in str function (to make sure they are strings)and then runs each one through url lib parse quote_plus as they are added to the result the cgi script builds up list of similar dictionaries and passes it to commonhtml to be formatted into selection list page in broader termsgenerating urls with parameters like this is one way to pass state information to the next script (along with cookieshidden form input fieldsand server databasesdiscussed in without such state informationusers would have to reenter the usernamepasswordand site name on every page they visit along the way incidentallythe list generated by this script is not radically different in functionality from what we built in the pymailgui program in though the two differ cosmetically figure - shows this strictly client-side gui' view on the same email list displayed in figure - it' important to keep in mind that pymailgui uses the tkinter gui library to build up user interface instead of sending html to browser it also runs entirely on the client and talks directly to email serversdownloading mail from the pop server to the client machine over sockets on demand because it retains memory for the duration of the sessionpymailgui can easily minimize mail server access after the initial header loadit needs to load only newly arrived email headers on subsequent load requests moreoverit can update its email index in-memory on deletions instead of reloading anew from the serverand it has enough state to perform safe deletions of messages that check for server inbox matches pymailgui also remembers emails you've already viewed-they need not be reloaded again while the program runs technicallyagainyou should generally escape separators in generated url links by running the url through cgi escapeif any parameter' name could be the same as that of an html character escape code ( &amp=highsee for more detailsthey aren' escaped here because there are no clashes between url and html the pymailcgi server