Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Generation time vs viewing time

import os
import time

# Write an HTML file to directory 'folder'.
# Danger: New file is called 'time.html'. Any file with that name
# will be overwritten without warning!
def timePage(folder):
  pageFileName = folder + os.sep + "time.html"
  file = open(pageFileName, "wt")

  file.write("<html><head><title>Time</title></head><body>")

  # Find time at which page is *created* using Python time module
  file.write("<p>This page was created on " + time.ctime() + "</p>")

  # Create Javascript text that will find current time when page is *viewed*
  currentTimeHTML = "<script>document.write(Date());</script>"
  file.write("<p>The current time is " + currentTimeHTML + "</p>")

  file.write("</body></html>")
  file.close()


Link to this Page