Old Paranoia Game in Python

McBooCzech petr at tpc.cz
Mon Jan 10 18:44:33 EST 2005


Newbie in Python.
I did copy the whole script form the web and save it as para1.py. I did
download pyparsing module and save it to
C:\\Python23\\Lib\\pyparsing122.
I did run following script:

import sys
sys.path.append('C:\\Python23\\Lib\\pyparsing122')

from pyparsing import *
extraLineBreak = White(" ",exact=1) + LineEnd().suppress()
text = file("Para1.py").read()
newtext = extraLineBreak.transformString(text)
file("para2.py","w").write(newtext)

I did try to run para2.py script, but following message

File "para2.py", line 169
choose(4,"You give your correct clearance",5,"You lie and claim
^
SyntaxError: EOL while scanning single-quoted string

So my questions are:
Why pyparser didn't correct the script?
What I am doing wrong?
Is it necessary to correct the script by hand anyway?

Petr




More information about the Python-list mailing list