Hi.
I'm trying to limit the output of a for loop to 200 counts and then breaking it. The purpose of the loop is to print out defined unicode characters onto a html table after a user sets the range.
So far I have this:
I've tried using this within the loop:
But nothing seems to work.
Thank you in advance for any help.
I'm trying to limit the output of a for loop to 200 counts and then breaking it. The purpose of the loop is to print out defined unicode characters onto a html table after a user sets the range.
So far I have this:
Code:
start = form["start"].value
end = form["end"].value
.
.
for char in range(int(start),int(end)+1):
name = unicodedata.name(unichr(char), "undefined" )
if name != "undefined":
print "<tr><td class=\"num\">" + str(char) + "</td><td><code class=\"html\">&#" + str(char) + ";</code>""</td><td class=\"char\"><span>&#" + str(char) + ";</span></td><td class=\"name\">" + name + "</td></tr>"
Code:
for count, char in enumerate(range(int(start),int(end)+1)):
if count >= 200:
break
Thank you in advance for any help.
Comment