comparison python/accentuate.py @ 125:a51df2382390

new program that does silly things
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 04 Mar 2011 11:43:15 -0800
parents
children 6d2e986c0dae
comparison
equal deleted inserted replaced
124:2f0baf81372f 125:a51df2382390
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 import random
5
6 mapping = {'a': ['Ȁ', 'ȁ'],
7 'c': ['ç'],
8 'e': ['ȅ'],
9 'n': ['И'],
10 'o': ['ổ', 'ȍ'],
11 't': ['Ṱ'],
12 }
13
14 if __name__ == '__main__':
15 import sys
16 arg = ' '.join(sys.argv[1:])
17 retval = []
18 for letter in arg:
19 if letter.lower() in mapping:
20 retval.append(random.sample(mapping[letter.lower()], 1)[0])
21 else:
22 retval.append(letter)
23 print ''.join(retval)