#!/usr/bin/env python3; ############################################################################### # This program simply writes characters from the alphabet to a file. # # Copyright © 2020 Richard Lesh. All rights reserved. ############################################################################### import Utils import sys def writeTextFile(filespec) : ofh = open(filespec, "w", encoding="utf8") # Latin alphabet for c in range(0x41, 0x5A + 1) : print(chr(c), file=ofh, end="") print("\n", file=ofh, end="") # Greek alphabet for c in range(0x391, 0x3A9 + 1) : print(chr(c), file=ofh, end="") # Cyrillic alphabet for c in range(0x410, 0x42F + 1) : print(chr(c), file=ofh, end="") print("\n", file=ofh, end="") # Katakana alphabet for c in range(0x30A0, 0x30FF + 1) : print(chr(c), file=ofh, end="") print("\n", file=ofh, end="") ofh.close() # Begin Main if (len(sys.argv) != 2) : print("Syntax: " + sys.argv[0] + " {filename}") sys.exit(1) filespec = sys.argv[1] try : writeTextFile(filespec) except OSError as ex : print("Error: " + str(ex))