newbie question
engsolnom at ipns.com
engsolnom at ipns.com
Wed Dec 31 19:51:13 EST 2003
Try getting rid of the 'return'
Norm
On 31 Dec 2003 16:14:33 -0800, gamasutra1000 at yahoo.com (Julia Osip) wrote:
>Hi, just started fiddling around with python, having some difficulty
>getting the following small play program to execute. Furious
>searching in the docs, manual, newsgroup did not avail me, does anyone
>have any ideas what might be the problem? Some sort of whitespace
>issue (im still unsure of whitespace rules)? I'm running Mac OS
>10.2.8, with MacPython 2.3.
>
>Thanks for any help you can give...
>
>the code
>...snip...
>#!/usr/bin/env python
>
>class World:
>
> """contains everything"""
>
> def __init__(self):
> self.name = "world"
> self.locations = [] # list of all locations in
>the world
> self.dist_locations = [] # the amount of travel time required
>between locations
> self.actors = [] # list of all actors in the world
> self.organizations = [] # list of all organizations in the world
> self.time = 0 # current moment in the world
> return
>
>...snip...
>
>the error
>...snip...
> File "<string>", line 7
> def __init__(self):
> ^
>SyntaxError: invalid syntax
>...snip...
More information about the Python-list
mailing list