below is the beginning of helloweb pyshowing the only new functions the firstfiletostrwill be standard function used in the future it is the inverse of strtofile the main program obtains the input in this simple examplethe input is used directlywith little further processing it is inserted into the web pageusing the file hellotemplate html as format string def filetostr(filename)new """return string containing the contents of the named file ""fin open(filename)contents fin read()fin close(return contents def main()person input('enter name'contents filetostr('hellotemplate html'format(**locals()browselocal(contentsnew although hellotemplate html is not intended to be viewed by the user (being template)you should open it in browser or web editor (kompozer or to look at it it is legal to create web page in web page editor with expressions in braces embedded in itif you look in the source view in kompozer or in web source editoryou will see something similar to the literal string in helloweb pyexcept the lines are broken up differently (this makes no difference in the formatted resultsince in htmlall white space is considered the same back in the normal mode in kompozeror in source mode for any html editoradd an extra line of text right after the line "hello{person}!then save the file again (under the same namerun the program helloweb py againand see that you have been able to change the appearance of the output without changing the python program itself that is the aim of using the template html pageallowing the web output formatting to be managed mostly independently from the python program more complicated but much more common situation is where the input data is processed and transformed into results somehowand these resultsoften along with some of the original inputare embedded in the output web page that is produced as simple exampleload and run the www example program additionweb pywhich uses the template file additiontemplate html the aim in the end of this is to have user input come from form on the web rather than the keyboard on local machinebut in either case the input is still transformed into results and all embedded in web page to make parts easily reusablei obtain the input in distinct place from where the input is processed in keeping with the later situation with web formsall input is of string type (using keyboard input for nowlook at the program you will see only few new linesbecause of the modular designmost of the program is composed of recent standard functions reused the only new code is at the beginning and is shown heredef processinput(numstr numstr )new '''process input parameters and return the final page as string ''num int(numstr transform input to output data num int(numstr total num +num return filetostr('additiontemplate html'format(**locals()def main()new numstr input('enter an integer'obtain input numstr input('enter another integer'contents processinput(numstr numstr process input into page browselocal(contentsdisplay page composing web pages in python