|
|
|
|
@ -72,7 +72,7 @@ def print_purple(*args): |
|
|
|
|
print(f"\033[95m{text}\033[0m") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def print_rainbow(*args): |
|
|
|
|
def print_rainbow(*args, single_line=False): |
|
|
|
|
""" |
|
|
|
|
Prints the provided arguments in a rainbow of colors. |
|
|
|
|
|
|
|
|
|
@ -87,16 +87,26 @@ def print_rainbow(*args): |
|
|
|
|
""" |
|
|
|
|
color_index = -1 |
|
|
|
|
text = "" |
|
|
|
|
|
|
|
|
|
for arg in args: |
|
|
|
|
if isinstance(arg, list): |
|
|
|
|
for i in arg: |
|
|
|
|
color_code, color_index = choose_color(color_index) |
|
|
|
|
text += f"{color_code}{i}\033[0m " |
|
|
|
|
if single_line: |
|
|
|
|
text += f"{color_code}{i}\n\033[0m " |
|
|
|
|
else: |
|
|
|
|
text += f"{color_code}{i}\033[0m " |
|
|
|
|
elif isinstance(arg, dict): |
|
|
|
|
for k, v in arg.items(): |
|
|
|
|
color_code, color_index = choose_color(color_index) |
|
|
|
|
text += f"{color_code}{k}: {v}\033[0m " |
|
|
|
|
if single_line: |
|
|
|
|
text += f"{color_code}{k}: {v}\n\033[0m " |
|
|
|
|
else: |
|
|
|
|
text += f"{color_code}{k}: {v}\033[0m " |
|
|
|
|
else: |
|
|
|
|
color_code, color_index = choose_color(color_index) |
|
|
|
|
text += f"{color_code}{arg}\033[0m " |
|
|
|
|
if single_line: |
|
|
|
|
text += f"{color_code}{arg}\n\033[0m " |
|
|
|
|
else: |
|
|
|
|
text += f"{color_code}{arg}\033[0m " |
|
|
|
|
print(text) |
|
|
|
|
|