Mercurial > repo
changeset 2333:dcbc60550ce6
<oerjan> cat colorize.1 >colorize
author | HackBot |
---|---|
date | Fri, 01 Mar 2013 03:21:18 +0000 |
parents | d58de78dc914 |
children | d938eb61bcc1 |
files | colorize |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/colorize Fri Mar 01 03:20:46 2013 +0000 +++ b/colorize Fri Mar 01 03:21:18 2013 +0000 @@ -4,6 +4,6 @@ w=raw_input() p=list('x'*len(w)+'C'*int((341-len(w))/3+1)) random.shuffle(p) -p=re.subst('C+','C',p) +p=re.sub('C+','C',p) i=(c for c in w) print ''.join(i.next() if c=='x' else chr(3)+'%02d' % random.randrange(2,15) for c in ['C']+p)