Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DDR0/2987288 to your computer and use it in GitHub Desktop.
Save DDR0/2987288 to your computer and use it in GitHub Desktop.
Circle letters from non-circled letters.
# -*- coding: utf-8 -*-
import sys
norm = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-=*. "
trans = "ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ⓪①②③④⑤⑥⑦⑧⑨⊝⊜⊛⊙○"
if len(sys.argv) < 2:
print('Useage: circleLetters.py "string" [-b -n]. (Too few args given.)')
sys.exit(1)
backupString = ''
if '-b' in sys.argv[2:]:
backupString = '⃝'
for char in sys.argv[1]:
index = norm.find(char)
if index >= 0:
print(end=trans[index])
else:
print(end=char + backupString)
if not '-n' in sys.argv[2:]:
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment