function is the simplestlet' start with its pages and scripts first the message composition page the root page send function steps users through two other pagesone to edit message and one to confirm delivery when you click on the send link on the main page in figure - the python cgi script in example - runs on the web server example - pp \internet\web\pymailcgi\cgi-bin\onrootsendlink py #!/usr/bin/python ""###############################################################################on 'sendclick in main root windowdisplay composition page ###############################################################################""import commonhtml from externs import mailconfig commonhtml editpage(kind='write'headers={'from'mailconfig myaddress}nothis file wasn' truncatedthere' not much to see in this script because all the action has been encapsulated in the commonhtml and externs modules all that we can tell here is that the script calls something named editpage to generate replypassing in something called myaddress for its "fromheader that' by design--by hiding details in shared utility modules we make top-level scripts such as this much easier to read and writeavoid code redundancyand achieve common look-and-feel to all our pages there are no inputs to this script eitherwhen runit produces page for composing new messageas shown in figure - most of the composition page is self-explanatory--fill in headers and the main text of the message ( "fromheader and standard signature line are initialized from settings in the mailconfig modulediscussed further aheadthe choose file buttons open file selector dialogsfor picking an attachment this page' interface looks very different from the pymailgui client program in but it is functionally very similar also notice the top and bottom of this page--for reasons explained in the next sectionthey are going to look the same in all the pages of our system the send mail script as usualthe html of the edit page in figure - names its handler script when we click its send buttonexample - runs on the server to process our inputs and send the mail message the pymailcgi server