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?
CODE:
import datetime
import calendar
while monday.weekday() != calendar.MONDAY:
monday -= oneday
oneweek = datetime.timedelta(days=7)
nextweek = today + oneweek
print next week
Error:
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'
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor