Help - For a game . Python variable declarations and constructor confusion?

Hi
Python array/list instantiation, import and other declarations are confusing me!

In my code attached, I have a main class for holding the data structures for a platform game level, basically x,y, positions and length of the platform, for now,
I don't understand why the 'module' object is not callable - error? It seems it should be trivial. What does that mean? I intend to end up with a list of terrain objects
In platform.py, must I do 'import platform as platform' is that telling me how to call methods, get data from that class?

Thanks
platform.py
mainclass.py
LVL 1
beavoidAsked:
Who is Participating?
 
peprCommented:
The reason is quite simple. The platform.py is the name of the file that implements the module platform. Inside the module, the class platform is defined. When you want to refer to the class from inside the module, you have to use both the module and the class identifiers. In your example, you should change the line to:
platf = platform.platform(290,290,500)

Open in new window

The first platform identifies the module, the second platform (after the dot) identifies the class.
1
 
beavoidAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.