[Tutor] A year's calendar to a text file?

Dick Moores rdm at rcblue.com
Sat Jul 3 05:05:37 EDT 2004


I'm just beginning to get into learning the use of file methods. I'm 
wondering what the limits are. One I've thought of is, can I write to a 
file a year's calendar created using the calendar module? I've got the 
trivial script for the calendar:

"""
# print any year's calendar from 1 C.E. through 9999 C.E.

import calendar

calendar.setfirstweekday(6) # sets first day of week to Sunday

year = int(raw_input("Enter year for which to print calendar "))

print "\n\n"
calendar.prcal(year)
"""

If this is possible, could someone tell me so, and get me headed in the 
right direction without giving me the whole solution?

Thanks, tutors

Dick Moores




More information about the Tutor mailing list