newbie question

Julia Osip gamasutra1000 at yahoo.com
Wed Dec 31 19:14:33 EST 2003


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