-------- Original Message --------
Subject: Re: A certainl part of an if() structure never gets executed.
Date: Wed, 12 Jun 2013 10:07:39 +0100
From: Fábio Santos <fabiosantos...@gmail.com>
To: Νικόλαος Κούρας <supp...@superhost.gr>
CC: python-list@python.org <python-list@python.org>
Newsgroups: comp.lang.python
References: <2bc90d3b-09c2-4315-9357-ff7f03946...@googlegroups.com>
<kp9bcq$o1i$2...@dont-email.me> <kp9d02$1jfb$1...@news.ntua.gr>
On Wed, Jun 12, 2013 at 9:54 AM, Νικόλαος Κούρας <supp...@superhost.gr>
wrote:
> but if enumerate yields 0 instead of '==========' then elif '=' not in
> year of course fails.
>
> So, i must tell:
>
> for i, month in enumerate(months):
> print('<option value="%s"> %s </option>' % (i, month) )
>
> to somehow return '==========' instead of 0 but don't know how.
> --
> http://mail.python.org/mailman/listinfo/python-list
Well, you could try this:
> for i, month in enumerate(months):
> if i == 0:
> month = ('=' * 10)
> print('<option value="%s"> %s </option>' % (i, month) )
No?
You can see if for yourself if you go to:
http://superhost.gr/?page=pelatologio.py
bottom down where the form drop down menus are:
search will work but f the suer just gives out the year it will never
make it to the specific if() branch.
--
http://mail.python.org/mailman/listinfo/python-list