Created
November 7, 2018 09:30
-
-
Save fractalbach/f32fd94b07bf7e7011c3c5e3c8185cd3 to your computer and use it in GitHub Desktop.
simple title printer that uses ascii box chars and maintains its width
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def title(s, L=70): | |
L = L - len(s) - 4 | |
l1 = L // 2 | |
l2 = L - l1 | |
prefix = l1*'═' + '╡' | |
postfix = '╞' + l2*'═' | |
print(prefix, s, postfix) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
════════════════════════╡ Samples of Output ╞═════════════════════════
Input Example:
Output: