demoPyVersionTool.py

demoPyVersionTool.py
1 version_data = {}
2 
3 try:
4  from sys import version, prefix
5  version_data['sys module'] = True
6  version_data['Python version'] = version
7  version_data['Python prefix'] = prefix
8 except:
9  version_data['sys module'] = False
10 
11 try:
12  import os
13  version_data['os module'] = True
14  version_data['3ds Max 2014 path environment variable'] = os.getenv(
15  "ADSK_3DSMAX_x64_2014")
16 except:
17  version_data['os module'] = False
18 
19 try:
20  import MaxPlus
21  version_data['MaxPlus module'] = True
22  version_data['3ds Max install path'] = MaxPlus.PathManager.MaxSysRootDir
23  version_data['MaxPlus version'] = MaxPlus.__version__
24 except:
25  version_data['MaxPlus module'] = False
26 
27 try:
28  import PyQt4.QtCore
29  version_data['PyQt module'] = True
30  version_data['PyQt QT version'] = PyQt4.QtCore.QT_VERSION_STR
31  version_data['PyQt version'] = PyQt4.QtCore.PYQT_VERSION_STR
32 except:
33  version_data['PyQt module'] = False
34 
35 try:
36  import PySide
37  import PySide.QtCore
38  version_data['PySide module'] = True
39  version_data['PySide version'] = PySide.__version__
40  # NOTE: if PyQt is loaded succesfully first, this may return a
41  # different version of Qt if the PySide Qt is different.
42  # it will just load the DLLs that it found.
43  version_data['PySide Qt version'] = PySide.QtCore.__version__
44 except:
45  version_data['PySide module'] = False
46 
47 for key in sorted(version_data):
48  print key, version_data[key]