Tip: Learn about the Python language before you start coding with Python. There is a very good tutorial, and it won’t take more than one hour to work through it. Especially the chapters on error messages and tracebacks. You won’t have fun with Python if you don’t understand what Python tells you in response to your code: http://docs.python.org/tut/tut.html
Idea: It seems your code utilizes the class “EggData”. This is a class provided by the Panda3D library. To use this class you have to import it first. So put this somewhere at the start of your code:
from pandac.PandaModules import EggData
Hint: You probably have to import some other modules too, e.g. EggVertex or EggPolygon.