I have done this in python 2.7 idle and it works well.
l = []
def one():
l.append('1one')
def two():
l.append(None)
def three():
l.append('three')
def four():
l.append(None)
def empty():
del l[:]
def Filter():
four()
two()
one()
three()
for item in l:
try:
print [x for x in l if x is not '' and x is not None'][0]
pass
except:
pass
empty()
if __name__=='__main__':
Filter()
My aim is to return values in the list 'l' to the view page. After which,
the list is to remain empty. When the list is not empty and I refresh the
page, new items keep adding to the 'l' in addition to the previous ones.
i don't know why it works in idle and not in web2py.
Kind regards
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.