#!/usr/bin/python import cgi, sys import aword_ as aword # python2.5 would fix this form = cgi.FieldStorage() print 'Content-Type: text/html' print k = form.keys() mode = None def r(x): return x.replace('\r', '') if 'wrap' in k: text1 = r(form['text'].value) text2 = aword.awrap(text1) elif 'unwrap' in k: text2 = r(form['text'].value) text1 = aword.aunwrap(text2) else: text1 = text2 = '' print '''
'''.replace('text1', text1) + ''' |