ExistingPython Code does not compile with Python 2.4

Hello All,

starting to migrate my project to the new panda and python version.

I have a CoreGlobal.py script that make the same that all the …Global from Panda3d ie creating a single instance of Core to be available to all other objects.

This Core is the unique entry point to my project, No Core.py=no Project.

In previous Python version, its works perfect.
In latest version i’ve got this error:

  File "E:\WG\ArkheniaFrameWork\binaries\Dragons_Server.py", line 21, in ?
    from CoreGlobal import *
ImportError: No module named CoreGlobal

Does someone has an idea what is wrong? CoreGlobal.py is a script not a module right now.

Ok for the first error i found out that python2.4 was casse dependant for filename , unlike python 2.2 but like any python version on linux.

Now i’ve got the following error:

Code is the following :

class Server( DirectObject ):
	def __init__( self ):
	     print "Server Initializing"    

Please help me if you can

I think you’re having the same problem as a lot of others. The problem is this - in the following import statement,

from direct.showbase.DirectObject import DirectObject

“direct” is the name of a subdirectory
“showbase” is the name of a subdirectory
“DirectObject” is the name of a file
“DirectObject” is the name of a class defined in that file

Unfortunately, the file and the class have the same name, so you have to be careful about which one you’re importing. If you say:

import direct.showbase.DirectObject

then you imported a pointer to the module. Ie, the variable “DirectObject” now points to the module, which in turn contains the class.

from direct.showbase.DirectObject import DirectObject

then you imported the class. Ie, the variable “DirectObject” contains a pointer to the class.

Thanks you Josh… I had found but i had no access to internet to update the post.