-
-
Save theychx/e6097ed97e49fa2370d2ecaeb6dff50c to your computer and use it in GitHub Desktop.
Print out large ASCII block letters using python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original font: http://www.stuffaboutcode.com/2013/08/raspberry-pi-minecraft-twitter.html | |
LETTERS = { | |
"a": ["###", "# #", "###", "# #", "# #"], | |
"b": ["###", "# #", "###", "# #", "###"], | |
"c": ["###", "# ", "# ", "# ", "###"], | |
"d": ["## ", "# #", "# #", "# #", "## "], | |
"e": ["###", "# ", "###", "# ", "###"], | |
"f": ["###", "# ", "###", "# ", "# "], | |
"g": ["###", "# #", "###", " #", "###"], | |
"h": ["# #", "# #", "###", "# #", "# #"], | |
"i": ["###", " # ", " # ", " # ", "###"], | |
"j": ["###", " #", " #", " #", "## "], | |
"k": ["# #", "## ", "# ", "## ", "# #"], | |
"l": ["# ", "# ", "# ", "# ", "###"], | |
"m": ["# #", "###", "###", "# #", "# #"], | |
"n": ["###", "# #", "# #", "# #", "# #"], | |
"o": ["###", "# #", "# #", "# #", "###"], | |
"p": ["###", "# #", "###", "# ", "# "], | |
"q": ["###", "# #", "###", " #", " #"], | |
"r": ["###", "# #", "## ", "# #", "# #"], | |
"s": ["###", "# ", "###", " #", "###"], | |
"t": ["###", " # ", " # ", " # ", " # "], | |
"u": ["# #", "# #", "# #", "# #", "###"], | |
"v": ["# #", "# #", "# #", "# #", " # "], | |
"w": ["# #", "# #", "# #", "###", "###"], | |
"x": ["# #", " # ", " # ", " # ", "# #"], | |
"y": ["# #", "# #", "###", " #", "###"], | |
"z": ["###", " #", " # ", "# ", "###"], | |
" ": [" ", " ", " ", " ", " "], | |
"1": [" # ", "## ", " # ", " # ", "###"], | |
"2": ["###", " #", "###", "# ", "###"], | |
"3": ["###", " #", "###", " #", "###"], | |
"4": ["# #", "# #", "###", " #", " #"], | |
"5": ["###", "# ", "###", " #", "###"], | |
"6": ["###", "# ", "###", "# #", "###"], | |
"7": ["###", " #", " #", " # ", "# "], | |
"8": ["###", "# #", "###", "# #", "###"], | |
"9": ["###", "# #", "###", " #", "###"], | |
"0": ["###", "# #", "# #", "# #", "###"], | |
"!": ["#", "#", "#", " ", "#"], | |
"?": ["###", " #", " # ", " ", " # "], | |
".": [" ", " ", " ", " ", "#"], | |
"[": ["##", "# ", "# ", "# ", "##"], | |
"]": ["##", " #", " #", " #", "##"], | |
"/": [" #", " #", " # ", " # ", "# "], | |
":": [" ", "#", " ", "#", " "], | |
"'": ["#", "#", " ", " ", " "], | |
} | |
def gen_letters(text): | |
bigletters = [LETTERS.get(i.lower(), LETTERS[" "]) for i in text] | |
return "\n".join([" ".join([b[l] for b in bigletters]) for l in range(5)]) | |
if __name__ == "__main__": | |
print(gen_letters("made with python 3.8!")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks.