Skip to content

Instantly share code, notes, and snippets.

@TimothyLoyer
Created September 17, 2019 18:24
Show Gist options
  • Save TimothyLoyer/45bfbc1a7b37dd5961ad016be6b5fc3f to your computer and use it in GitHub Desktop.
Save TimothyLoyer/45bfbc1a7b37dd5961ad016be6b5fc3f to your computer and use it in GitHub Desktop.
def wrap_log_output(message: str, line_char: str = "#", log: logger = logger.info):
if not isatty(sys.stdin.fileno()):
log(message)
else:
_, columns = subprocess.check_output(["stty", "size"]).split()
def hr():
print(line_char * int(columns))
hr()
log(message)
hr()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment