Pythonwin (win32all build 148) on Python 2.2.1 on Win2K, bogus syntax e

Dennis Lee Bieber wlfraed at ix.netcom.com
Tue Sep 24 22:04:03 EDT 2002


A. Dimsdale Fetus A. Moser fed this fish to the penguins on Tuesday 24 
September 2002 05:04 pm:

> I am running Pythonwin (win32all build 148) on Windows 2000
> Professional with Python 2.2.1. When I attempt to run a Python script
> in it, it halts the running of the script on supposed syntax errors,
> which are completely bogus. Examples:
> First line of our (Aaron L. Dimsdale and Alex S. Moser) first
> semi-significant Python script, called fight:
> """fight.py 5.0 -- crappy primitive fighting game by alex s. moser &
> aaron l. dimsdale"""
>         ^^^ (note: no linebreak in that line)
> """if one of the players does not say "atk" or "rest" when asked, they
> will \ forfeit their turn"""
> 
> Pythonwin barfed on the quote marks marked by carets, returning:
> "Failed to run script - syntax error - invalid syntax".
> I removed those quote marks and the quote marks at the beginning of
> the second documentation line, and left those two lines as one string.

        Is that supposed to be "doc-string"? (since it isn't assigned to 
anything?)... Try:

"""
fight.py 5.0 -- crappy primitive fighting game by alex s. moser & ...

if one of the players does not say "atk" or "rest" when asked,
they will forfeit their turn
"""

        Triple quotes work to delimit multiple line strings.


> Then, several lines later:
> 
> p1char = str(raw_input("Player 1, choose your character class: "))

        I'd almost suspect a misplaced quote mark somewhere, but I presume 
Pythonwin is color-coding properly...

--
 > ============================================================== <
 >   wlfraed at ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed at dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >        Bestiaria Home Page: http://www.beastie.dm.net/         <
 >            Home Page: http://www.dm.net/~wulfraed/             <



More information about the Python-list mailing list