diff options
Diffstat (limited to 'squeeze.py')
-rw-r--r-- | squeeze.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/squeeze.py b/squeeze.py deleted file mode 100644 index ce56a86..0000000 --- a/squeeze.py +++ /dev/null @@ -1,29 +0,0 @@ -import re -import sys - -output = '' - -while True: - line = sys.stdin.readline() - if not line: break - if line[0] == '#': - if output: - print output - output = '' - print line.strip() - else: - x = re.findall('\w+|\W',line) - for u in x: - if not u.isspace(): - if len(output) + len(u) > 140: - print output - output = '' - if (re.match('\w',output[-1:]) and re.match('\w',u[:1])) or (output[-1:] == '=' and u[:1] == '-'): - if len(output) + 1 + len(u) > 140: - print output - output = '' - else: - output += ' ' - output += u - -print output |