November 22nd, 2004, 07:58 AM
Question, new here..
Lets say i have this..
x = int(form["start"].value)
y = int(form["end"].value)
z = 0
while ((x+z) <= y):
print (x+z), '&#' + str(x+z) + ';', unichr(x+z) + unicodedata.name(unichr(x+z))
z = z + 1
and i want to put (x+z), '&#' + str(x+z) + ';', unichr(x+z) + unicodedata.name(unichr(x+z)) in a table in html, how would i do that?
November 22nd, 2004, 09:19 AM
Maybe i should make it more clear..
1. Create the query page that asks the user for the range they want to view.
2.Create a web script that just outputs the two numbers the user entered, like "945 949".
3. Modify the web script so it counts from the first to last number they entered. That is, create a loop and just output the numbers, like "945 946 947 948 949."
4. Modify the web script so it outputs the first column of the table. Add in the second and third columns. Check to make sure the output is valid.
5. Experiment with the unicodedata module in the Python interpreter. Make sure you can manually convert a number to the Unicode character description, as described above. (Your computer may or may not be able to display the actual Unicode character if you try the unichr function. You might see something like \u20ac instead. As long as the function doesn't give an error, it should be fine.)
6. Add the character name output to your program and test it with a range like 945–949 or 32–97 where all of the characters are defined.
7.Add the checking for undefined characters and limit the output to 200 rows.