Oct-22-2022, 09:08 AM
Sharing a tool that a wrote that creates a uniform 'banner'.
I use use this for creating code block markers as well as banners for cli based apps, but use it how you will.
I use use this for creating code block markers as well as banners for cli based apps, but use it how you will.
def banner(**args): if not args: print("Remember: do one thing and do it well.") return else: text = args['text'] length = args['length'] print("#", end='') if len(text) % 2: print(f"<{text}>".center(length, '='), end='') else: print(f"<{text}>".center(length + 1, '='), end='') print("#", end='') print() return length = 44 print() text = input("Banner text: ") if text: banner(text=text, length=length) else: banner()
Sig:
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein