[Tutor] Error while using calendar module in Python 2.7
ranjand2005 at gmail.com
Sat Mar 5 08:13:06 CET 2011
I ran the following code in python 2.6 and then in python 2.7 (using
calendar module) to manipulate dates and times
The following code works fine in Python 2.6 but throws up an error in Python
2.7. Can anyone please say why?
while monday.weekday() != calendar.MONDAY:
monday -= oneday
oneweek = datetime.timedelta(days=7)
nextweek = today + oneweek
print next week
Traceback (most recent call last):
File "C:\Python27\Foursoft\calendar.py", line 33, in <module>
while friday.weekday() != calendar.FRIDAY:
AttributeError: 'module' object has no attribute 'FRIDAY'
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor