Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #58343
| From | Nick the Gr33k <nikos.gr33k@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Printing appropriately based on values retrieved |
| Date | 2013-11-02 21:25 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <l53jjd$83c$1@dont-email.me> (permalink) |
| References | <l53g36$hmh$1@dont-email.me> |
Στις 2/11/2013 8:25 μμ, ο/η Nick the Gr33k έγραψε: > for row in newdata: > (host, refs, city, useros, browser, visits, hits, downloads) = row > > if downloads != 'Δεν έχει κατεβάσει ταινία': > print( '<td><select>' ) > for n, download in enumerate( downloads ): > if n == 0: > op_selected = 'selected' > else: > op_selected = '' > print( '<option %s> %s </option>' % (op_selected, download) ) > print( '</select></td>' ) > else: > print( '<td><center><b><font color=white> 'No downloads yet' > </td>' ) > > > The above code is supposed to print a select menu in case it has found > tha user has downloaded files from my website and if he didn't to just > print a string 'No downloads yet'. > > Unfortunately as i have it, it prints 'No downloads yet' inside a select > menu giving the impression that the 'No downloads yet' was actually a file. > > how should i write it to have the result i want it to be? -- if downloads != 'Δεν έχει κατεβάσει ακόμη ταινία!': print( '<td><select>' ) for n, download in enumerate( downloads ): if n == 0: op_selected = 'selected' else: op_selected = '' print( '<option %s> %s </option>' % (op_selected, download) ) print( '</select></td>' ) times = times + 1 if times == 0: print( '<td><center><b><font color=white> Δεν έχει κατεβάσει ακόμη ταινία! </td>' ) I just tried this this didn't work either :( Please someone t
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Printing appropriately based on values retrieved Nick the Gr33k <nikos.gr33k@gmail.com> - 2013-11-02 20:25 +0200 Re: Printing appropriately based on values retrieved Nick the Gr33k <nikos.gr33k@gmail.com> - 2013-11-02 21:25 +0200
csiph-web