from direct.showbase.DirectObject import DirectObject
class ReadKeys(DirectObject.DirectObject):
def __init__(self):
self.accept("w",walk)
self.accept("a",rotate,[-1])
self.accept("d",rotate,[1])
It run then closes down, this is what the command says.
C:\>python test.py
DirectStart: Starting the game.
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
Traceback (most recent call last):
File "test.py", line 53, in <module>
class ReadKeys(DirectObject.DirectObject):
AttributeError: class DirectObject has no attribute 'DirectObject'