summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2022-08-16 18:23:57 -0500
committerAnthony Wang2022-08-16 18:23:57 -0500
commit84c0f9a2501fbb77e93586e9ac25da1f35945acf (patch)
treeaa2b7f2bf9e47bbb70cd0394ba2c001922493bef
Write a Python script for generating an HTML file of almost every Unicode characterHEADmaster
-rw-r--r--.gitignore1
-rw-r--r--main.py16
2 files changed, 17 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..dcaf716
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+index.html
diff --git a/main.py b/main.py
new file mode 100644
index 0000000..5295f05
--- /dev/null
+++ b/main.py
@@ -0,0 +1,16 @@
+def color(x):
+ ret = ''
+ for i in range(0, 6):
+ ret += hex(2 * (x // 8**i % 8))[2:]
+ return ret
+
+f = open('index.html', 'w')
+f.write('<meta charset="utf-8">\n')
+f.write('<body style="font-size:6px">\n')
+for i in range(0, 2**18):
+ try:
+ f.write('<span style="display:inline-block;width:8px;background-color:#' + color(2**18 - 1 - i) + '">' + chr(i) + '</span>\n')
+ except:
+ pass
+f.write('</body>\n')
+f.close()