Old Paranoia Game in Python

Paul McGuire ptmcg at austin.rr._bogus_.com
Sun Jan 9 22:41:02 EST 2005


<mensanator at aol.com> wrote in message
news:1105318366.966577.107460 at c13g2000cwb.googlegroups.com...
>
> Aahz wrote:
> > Trust the computer, the computer is your friend.
>
> However, the computer isn't a fuckin' mind reader.
>
> If you're going to post source code on the usenet, don't
> have lines longer than 72 characters. Otherwise you'll
> find your code has wrapped lines. This not only causes
> syntax errors in your choose and print statements but
> also fucks up the formatting of of printed paragraphs.
>
> Stupid human.
>

I copy-and-pasted to a file named para1.py, then wrote the following python
script with pyparsing to fix the erroneous line breaks.

-- Paul

===============================
from pyparsing import *

extraLineBreak = White(" ",exact=1) + LineEnd().suppress()
text = file("para1.py").read()
newtext = extraLineBreak.transformString(text)
file("para2.py","w").write(newtext)





More information about the Python-list mailing list