-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.py
executable file
·57 lines (46 loc) · 1.47 KB
/
template.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
49
50
51
52
53
54
55
56
57
'''
[FILENAME]
[AUTHOR]
Created: [DATE]
Updated: [DATE]
Description: [DESCRIPTION]
'''
# This part is used for https://github.com/hussein-esmail7/template-maker
# templateDescription: Python Programming Document
import os
import sys
# ========= VARIABLES ===========
# ========= COLOR CODES =========
color_end = '\033[0m'
color_darkgrey = '\033[90m'
color_red = '\033[91m'
color_green = '\033[92m'
color_yellow = '\033[93m'
color_blue = '\033[94m'
color_pink = '\033[95m'
color_cyan = '\033[96m'
color_white = '\033[97m'
color_grey = '\033[98m'
# ========= COLORED STRINGS =========
str_prefix_q = f"[{color_pink}Q{color_end}]\t "
str_prefix_y_n = f"[{color_pink}y/n{color_end}]"
str_prefix_err = f"[{color_red}ERROR{color_end}]\t "
str_prefix_done = f"[{color_green}DONE{color_end}]\t "
str_prefix_info = f"[{color_cyan}INFO{color_end}]\t "
error_neither_y_n = f"{str_prefix_err} Please type 'yes' or 'no'"
def yes_or_no(str_ask):
while True:
y_n = input(f"{str_prefix_q} {str_prefix_y_n} {str_ask}").lower()
if y_n[0] == "y":
return True
elif y_n[0] == "n":
return False
if y_n[0] == "q":
sys.exit()
else:
print(f"{str_prefix_err} {error_neither_y_n}")
def main():
# CODE HERE
sys.exit()
if __name__ == "__main__":
main()