On Thu, Oct 23, 2008 at 2:54 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>wrote:
> Hello everyone, > I would like to know what isn't good in my script. > #!/usr/bin/python > # -*- coding: iso-8859-15 -*- > from time import strftime > import datetime > t = input(datetime.date) > global t > print t.strftime("Day %w of the week a %A . Day %d of the month (%B). > ") > print t.strftime("Day %j of the year (%Y), in week %W of the year.") > raw_input() > i get error : > print t.strftime("Day %w of the week a %A . Day %d of the month > (%B). ") > AttributeError: 'tuple' object has no attribute 'strftime' > Thanks for your Help > -- 1) why are you using input and raw_input? Are you trying to use them as breakpoints? 2) Do you understand what t.strftime is doing? It is trying to access an attribute of t (a tuple) called 'strftime'. A tuple does not have an attribute by that name, so it throws an AttributeError. You probably want print strftime("Day %w of the week a %A . Day %d of the month (%B).", t) #this checks globals() for an attribute called strftime > http://mail.python.org/mailman/listinfo/python-list >
-- http://mail.python.org/mailman/listinfo/python-list