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("ADSK_3DSMAX_x64_2014")
15 except:
16  version_data['os module'] = False
17 
18 try:
19  import MaxPlus
20  version_data['MaxPlus module'] = True
21  version_data['3ds Max install path'] = MaxPlus.PathManager.MaxSysRootDir
22  version_data['MaxPlus version'] = MaxPlus.__version__
23 except:
24  version_data['MaxPlus module'] = False
25 
26 try:
27  import PyQt4.QtCore
28  version_data['PyQt module'] = True
29  version_data['PyQt QT version'] = PyQt4.QtCore.QT_VERSION_STR
30  version_data['PyQt version'] = PyQt4.QtCore.PYQT_VERSION_STR
31 except:
32  version_data['PyQt module'] = False
33 
34 try:
35  import PySide
36  import PySide.QtCore
37  version_data['PySide module'] = True
38  version_data['PySide version'] = PySide.__version__
39  # NOTE: if PyQt is loaded succesfully first, this may return a
40  # different version of Qt if the PySide Qt is different.
41  # it will just load the DLLs that it found.
42  version_data['PySide Qt version'] = PySide.QtCore.__version__
43 except:
44  version_data['PySide module'] = False
45 
46 for key in sorted(version_data):
47  print key, version_data[key]
48 
49