Few coding questions.

This means that this name is not defined. You can define it by

(1) Writing your own class ‘DirectObject’. This name has to be a class object, or Python will complain about it having the wrong type for a parent class).

(2) Import this name from somewhere else.

You want to do the later:

from direct.showbase.DirectObject import DirectObject

For a bit of (serious) fun: Start your python interpreter, type the following command, and pay attention to the very last line.

import this

enn0x