with open("ascii.md", "w") as f: f.write("| Dec | Hex | Octal | Binary | Character |\n") f.write("|-----|------|-------|----------|-----------|\n") for i in range(0,128): ch = chr(i) desc = "" if i < 32: ch = "*" match i: case 0: ch = "NUL" case 1: ch = "SOH" case 2: ch = "STX" case 3: ch = "ETX" case 4: ch = "EOT" case 5: ch = "ENQ" case 6: ch = "ACK" case 7: ch = "BEL" case 8: ch = "BS" case 9: ch = "HT" case 10: ch = "LF" case 11: ch = "VT" case 12: ch = "FF" case 13: ch = "CR" case 14: ch = "SO" case 15: ch = "SI" case 16: ch = "DLE" case 17: ch = "DC1" case 18: ch = "DC2" case 19: ch = "DC3" case 20: ch = "DC4" case 21: ch = "NAK" case 22: ch = "SYN" case 23: ch = "ETB" case 24: ch = "CAN" case 25: ch = "EM" case 26: ch = "SUB" case 27: ch = "ESC" case 28: ch = "FS" case 29: ch = "GS" case 30: ch = "RS" case 31: ch = "US" case 32: ch = "SPACE" case 127: ch = "DEL" f.write(f"| {i:<3} | {i:#04x} | {i:#05o} | {i:08b} | {ch:<9} |\n")