Detect panda3d version

Hi, we have written a Panda 3D app in Python that we run on Linux machines only. The app is both running on older Ubuntu machines using Panda 1.6, and some newer Ubuntu machines with Panda 1.7.

There is only one small bit that is different in the newer versions of Panda, so I have to detect the version of Panda at runtime.

At the moment I get the version from the apt cache using python-apt, because I can’t seem to find a way to get the version directly from Panda. This apt method works, but it seems a bit ugly. Is there any way to get the version of Panda 3D from Panda itself?

panda3d.org/reference/1.7.2/ … System.php

from panda3d.core import PandaSystem
print "Panda version:", PandaSystem.getVersionString()

ynjh_jo’s response was much quicker though…

Hope this helps,
~powerpup118

Thanks a lot, I found to make it work in Panda 1.6 as well I had to change the import to:

from pandac.PandaModules import PandaSystem

The old way of importing seems to work with 1.7 and 1.8 too, which is great.