Sunday, August 15, 2010

Current Version

It is often necessary to know the exact Python version for debugging or installing modules.
import sys
print sys.version_info
It is also sometimes important to know what Maya version is currently running, especially for backwards compatibility.
import maya.cmds as cmds
print cmds.about(version=1)


If you are using an IDE and want to make sure your code will execute as expected without having to worry about version control set its default Python interpreter to C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe.