Skip to content

Instantly share code, notes, and snippets.

@theychx
Forked from vampjaz/letters.py
Last active May 20, 2020 22:50
Show Gist options
  • Save theychx/e6097ed97e49fa2370d2ecaeb6dff50c to your computer and use it in GitHub Desktop.
Save theychx/e6097ed97e49fa2370d2ecaeb6dff50c to your computer and use it in GitHub Desktop.
Print out large ASCII block letters using python
# 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!"))
@shanedoolane
Copy link

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment