Scripts/color_io.py

17 lines
347 B
Python
Raw Permalink Normal View History

2024-04-17 18:14:17 -04:00
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def input_print(p, default = ""):
eprint("\033[93m" + p, end=':\033[0m ', flush=True)
inp = input("")
if inp:
return inp
else:
if not default:
return input_print(p, default)
return default
def green_print(p):
eprint("\033[92m" + p + "\033[0m")