Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3.6
- """
- Ich musste mal einfach ein bisschen kreativ tätig sein.
- Ist bleeding edge. Python 3.6 required.
- """
- import sys
- import unicodedata
- import string
- uppercase = {c: unicodedata.lookup(f'Circled Latin Capital Letter {c}') for c in string.ascii_uppercase}
- number_names = ['ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 'NINE']
- numbers = {str(n): unicodedata.lookup(f'Circled Digit {number_names[n-1]}') for n in range(1, 10)}
- def translate(text, fill=''):
- return fill.join(uppercase.get(c) or numbers.get(c) or c for c in text)
- if __name__ == '__main__':
- text = ' '.join(sys.argv[1:]) or 'Hallo Andre, 123'
- result = translate(text.upper())
- print(result)
- # 'ⒽⒶⓁⓁⓄ ⒶⓃⒹⓇⒺ, ①②③'
Add Comment
Please, Sign In to add comment