Skip to content

Instantly share code, notes, and snippets.

@influx6
Forked from Philogy/headers.py
Created October 9, 2022 07:54
Show Gist options
  • Save influx6/59a7f017cb6b22ffa70ed29aeb66f984 to your computer and use it in GitHub Desktop.
Save influx6/59a7f017cb6b22ffa70ed29aeb66f984 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