-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathascii_art.py
48 lines (39 loc) · 1.17 KB
/
ascii_art.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
def ascii_art():
from pyfiglet import figlet_format #ascii art
from termcolor import cprint #colorize
# output text
text = figlet_format(input("What would you like to say? "))
# text/highlight color options
valid_colors = (
"red",
"yellow",
"green",
"blue",
"magenta",
"cyan",
"white")
# validate color option
color = input(
f"What color do you want it to be? \nOptions are {valid_colors} ").lower()
if color not in valid_colors:
color = "red"
# validate highlight option
highlight = input(
f"What background color do you want? \nOptions are {valid_colors} ").lower()
if highlight not in valid_colors:
highlight = None
else:
highlight = "on_" + highlight
# validate effect option
valid_effects = (
"bold",
"dark",
"underline",
"blink",
"reverse",
"concealed")
effects = input(
f"Any special effects? \nOptions are {valid_effects} ").split(" ")
effects = set(effects).intersection(valid_effects)
cprint(text, color, highlight, effects)
ascii_art()