[Tutor] It's the webpage_editor file i forgot to attach to previous message

matthew mazzola mdmazzola at charter.net
Thu Feb 5 19:30:50 EST 2004


Skipped content of type multipart/alternative-------------- next part --------------
# Make Your Own Webpage
# THIS IS MINE I MADE IT ALL MINE
# Matt Mazzola - 2/4/04

#Welcome User
print "\t Welcome to Matt Mazzola's\n\t\t-----------\n\t\tWeb Page Editor"

#Ask them what they want to have on their Page by main elemts
raw_input("press enter to see the layout of the page...")
print \
"""
                      Here is the layout of your page.
                      
        (Pay attention to the sections of the page
        because you will later be asked what you
        want in those sectoins.)
        Also, rember title is the what you want the window title bar to display
        and background is the color of the web page backgroud.
"""

layout = """
  title/background
 +----------------------------------------------------------------------+
 |                                 Header                               |
 +----------------------------------------------------------------------+
 +-----------------+ +-----------------------------+ +------------------+
 | Navigation      | |  Main Topic Title           | |  Interaction     |
 +-----------------+ +-----------------------------+ +------------------+
 |link 1           | | Sub Title                   | | Questoin for poll|
 |link 2           | |   paragraph                 | | form for poll    |
 +-----------------+ +-----------------------------+ +------------------+
 +----------------------------------------------------------------------+
 |                               Footer                                 |
 +----------------------------------------------------------------------+
     """
print layout

raw_input("Press enter to continue on to the building part...")

title = None
bgcolor = None
header = None
link_1 = None
link_1_src = None
link_2 = None
link_2_src = None
main_topic_title = None
sub_title = None
paragraph = None
question = None
footer = None

title = raw_input("What would you like the Title to display?  ")
bgcolor = raw_input("What would you like the background to be?  ")
header = raw_input("What would you like the Header to display?  ")
link_1 = raw_input("What would you like the Link 1 to display?  ")
link_1_src = raw_input("Where would you like the link to go?"+
                       "\n\tYou need to type the whole URL ie: http://www.google.com  ")
link_2 = raw_input("What would you like the Link 2 to display?  ")
link_1_src = raw_input("Where would you like the link to go?"+
                       "\n\tYou need to type the whole URL ie: http://www.google.com  ")
main_topic_title = raw_input("What would you like the Main Topic Title to display?  ")
sub_title = raw_input("What would you like the Sub Title to display?  ")
paragraph = raw_input("How would you like the Paragraph to read? ")
question = raw_input("What would you like the Question to ask?  ")
option_1 = raw_input("What would you like Option 1 to be?")
option_2 = raw_input("What would you like Option 2 to be?")
footer = raw_input("What would you like the Footer to display?  ")

print
"""
Now we are going to create a text file which you need to
open in notepad then save as a *.html file so you cab open
it in a webrowser and view it
"""

name = raw_input("what would you like to name the file?"+
                 "( it should be something you can remember"+
                 " since you will have to reopen it several times.)"+
                 "*** It must end in .txt ***")

matts_template = ["<html>",
                    "<head>",
                    "<title>" + title + "</title>",
                    "</head>",
                    "<body>",
                    "<table width=\"100%\">",
                    "  <tr>",
                    "    <td>",
                    "  <table width=\"75%\" align=\"center\">",
                    "    <tr>",
                    "      <th bgcolor=\"66CCCC\">",
                    "<h2>" + header + "</h2>",
                    "      </th>",
                    "    </tr>",
                    "  </table>",
                    "    </td>",
                    "  </tr>",
                    "  <tr>",
                    "    <td>",
                    "  <table width=\"20%\" align=\"left\">",
                    "    <tr>",
                    "      <td>",
                    "  <table width=\"100%\" align=\"top\" cellspacing=\"1\" bgcolor=\"#009999\">",
                    "    <tr>",
                    "      <td bgcolor=\"#66CCCC\">",
                    "Navigation",
                    "      </td>",
                    "    </tr>",
                    "    <tr>",
                    "      <td bgcolor=\"#ACE6E6\">",
                    "<a href=\"" + link_1_src + "\">" + link_1 +"</a><br>",
                    "<a href=\"" + link_2_src + "\">" + link_2 +"</a><br>",
                    "      </td>",
                    "    </tr>",
                    "  </table>",
                    "      </td>",
                    "    </tr>",
                    "  </table>",
                    "  <table width=\"58%\" align=\"left\">",
                    "    <tr>",
                    "      <td>",
                    "  <table width=\"100%\" align=\"left\" cellspacing=\"1\"  bgcolor=\"#009999\">",
                    "    <tr>",
                    "      <td bgcolor=\"#66CCCC\">",
                    "<h3>" + main_topic_title + "</h3>",
                    "      </td>",
                    "    </tr>",
                    "    <tr>",
                    "      <td bgcolor=\"#ACE6E6\">",
                    "" + sub_title + "<br><br>",
                    "" + paragraph + "",
                    "      </td>",
                    "    </tr>",
                    "  </table>",
                    "      </td>",
                    "    </tr>",
                    "  </table>",
                    "  <table width=\"20%\" align=\"left\">",
                    "    <tr>",
                    "      <td>",
                    "  <table width=\"100%\" align=\"left\" cellspacing=\"1\"  bgcolor=\"#009999\">",
                    "   <tr>",
                    "      <td bgcolor=\"#66CCCC\">",
                    "Interact",
                    "      </td>",
                    "    </tr>",
                    "    <tr>",
                    "      <td bgcolor=\"#ACE6E6\">",
                    ""+ question + "<br>",
                    "<form>",
                    "<input type=\"radio\" name=\"hot\">--" + option_1 + "<br>",
                    "<input type=\"radio\" name=\"hot\">--" + option_2 + "<br>",
                    "</form>",
                    "      </td>",
                    "    </tr>",
                    "  </table>",
                    "      </td>",
                    "    </tr>",
                    "  </table>",
                    "    </td>",
                    "  </tr>",
                    "  <tr>",
                    "    <td>",
                    "  <table width=\"75%\" align=\"center\">",
                    "    <tr>",
                    "      <th bgcolor=\"66CCCC\">",
                    "<h2>" + footer + "</h2>",
                    "      </th>",
                    "    </tr>",
                    "  </table>",
                    "    </td>",
                    "  </tr>",
                    "</table>",
                    "</body>",
                    "</html>"]

text_file = open( name , "w")
text_file.writelines(matts_template)
text_file.close()
raw_input("Thank You for making your own" \
          +"proffessional web site with my editor.")


More information about the Tutor mailing list