Printing appropriately based on values retrieved

N

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?
 
N

Nick the Gr33k

Στις 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top