Mercurial > hg > config
comparison python/a8e.py @ 82:a7857000e206
oops!
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 30 Jun 2010 09:45:03 -0700 |
parents | 51a6ec0433f7 |
children |
comparison
equal
deleted
inserted
replaced
81:51a6ec0433f7 | 82:a7857000e206 |
---|---|
8 retval = [] | 8 retval = [] |
9 for word in text: | 9 for word in text: |
10 if len(word) < 4: | 10 if len(word) < 4: |
11 retval.append(word) | 11 retval.append(word) |
12 else: | 12 else: |
13 retval.append(word[0] + '%d' % (len(word) - 2) + word[1]) | 13 retval.append(word[0] + '%d' % (len(word) - 2) + word[-1]) |
14 return ' '.join(retval) | 14 return ' '.join(retval) |
15 | 15 |
16 def main(args=sys.argv[1:]): | 16 def main(args=sys.argv[1:]): |
17 if len(args) == 1 and (args[0].startswith('http://') | 17 if len(args) == 1 and (args[0].startswith('http://') |
18 or args[0].startswith('https://')): | 18 or args[0].startswith('https://')): |