please click on the new address to jump to this pageand update any links accordingly you will be redirectly shortly to fully understand this templateyou have to know something about htmla web page description language that we'll explore in part iv but for the purposes of this exampleyou can ignore most of this file and focus on just the parts surrounded by dollar signsthe strings $server$$home$and $fileare targets to be replaced with real values by global text substitutions they represent items that vary per site relocation and file page generator script nowgiven page template filethe python script in example - generates all the required forward-link files automatically example - pp \system\filetools\site-forward py ""###############################################################################create forward-link pages for relocating web site generates one page for every existing site html fileupload the generated files to your old web site see ftplib later in the book for ways to run uploads in scripts either after or during page file creation ###############################################################################""import os servername 'learning-python comhomedir 'bookssitefilesdir ' :\temp\public_htmluploaddir ' :\temp\isp-forwardtemplatename 'template htmltrywhere site is relocating to where site will be rooted where site files live locally where to store forward files template for generated pages os mkdir(uploaddirexcept oserrorpass make upload dir if needed template open(templatenameread(sitefiles os listdir(sitefilesdirload or import template text filenamesno directory prefix count for filename in sitefilesif filename endswith(html'or filename endswith(htm')fwdname os path join(uploaddirfilenameprint('creating'filename'as'fwdname complete system programs