Re: Python Script Bug

2008-10-23 Thread Terry Reedy
Chris Rebert wrote: global t 'global' declarations are only allowed (and only make sense) inside a function. Remove the above line. Global statements are *allowed* anywhere (by BDFL decision - does not hurt and he wants to keep code in and out of functions as identical as possible), but re

Re: Python Script Bug

2008-10-23 Thread Bruno Desthuilliers
Chris Rebert a écrit : (snip) 'global' declarations are only allowed (and only make sense) inside a function. Well, they _are_ actually allowed outside a function. But they indeed only make sense within !-) (snip) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Script Bug

2008-10-23 Thread Benjamin Kaplan
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.strf

Re: Python Script Bug

2008-10-23 Thread Chris Rebert
On Thu, Oct 23, 2008 at 11:54 AM, [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) input() does not do wha

Python Script Bug

2008-10-23 Thread [EMAIL PROTECTED]
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 yea