Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. def multiheader(lhs="", rhs="", width=80, nonewline=False):
  2.  
  3.     if not lhs and not rhs:
  4.         return f"|b{'-' * width}|n"
  5.     else:
  6.         #actual = width - (len(strip_ansi(lhs)) + len(strip_ansi(rhs)) + 10)
  7.         actual = width - (len(strip_ansi(lhs)) + len(strip_ansi(rhs)) + 22)
  8.         if actual < 0:
  9.             actual = 0
  10.         nl = '\n' if not nonewline else ''
  11.  
  12.         #return f"|b--[|n |C{lhs}|n |b]{'-' * actual}[|n |w{rhs}|n |b]--|n{nl}"
  13.         return f"|b--- |b<< |c{lhs} |b>> |b{'-' * actual} |b<< |c{rhs} |b>> |b---|n{nl}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement