Skip to content

Instantly share code, notes, and snippets.

@Philogy
Created October 9, 2022 02:03
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Philogy/d73a343bea1e574fe5cc70ec684d0cd8 to your computer and use it in GitHub Desktop.
Save Philogy/d73a343bea1e574fe5cc70ec684d0cd8 to your computer and use it in GitHub Desktop.
Transmission11s Style Headers In Python
#!/bin/python3
import sys
import pyperclip
def main():
args = sys.argv
if len(args) != 2:
raise ValueError(f'Invalid argument count {len(args)} expected 2')
word = args[1]
header = ' /*//////////////////////////////////////////////////////////////\n'\
+ ' ' * ((64 - len(word)) // 2)\
+ word.upper()\
+ '\n //////////////////////////////////////////////////////////////*/'
print(header)
pyperclip.copy(header)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment