Created
June 25, 2012 08:11
-
-
Save DDR0/2987288 to your computer and use it in GitHub Desktop.
Circle letters from non-circled letters.
This file contains hidden or 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
# -*- 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