Hi, 

How do I print all results from a while loop to a view page?

Code example:
text = "Mothers name is Maria \n Fathers name is Josef \n Childsname is 
Jesus "
total = text.count("is")
count = 0
where_is = 0
name_is = 0

while (count < total):
name_is = text.find("is")+3
text = text[name_is:100]
where_is = text.find(" ")
print text[0:where_is]
count = count + 1


This give results:
Maria
Josef
Jesus

If I replace "print text[0:where_is]" with "return 
dict(message=(text[0:where_is]))"
and have a view with code "{{=message}}" It will only give result "Maria" 
to the webpage.

Is it possible to do this without code all this into the view?

Thanks in advance !

-- 



Reply via email to