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 2017 path environment variable'] = os.getenv(
15  "ADSK_3DSMAX_x64_2017")
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.GetMaxSysRootDir()
23  version_data['MaxPlus version'] = MaxPlus.__version__
24 except:
25  version_data['MaxPlus module'] = False
26 
27 try:
28  import PySide2
29  import PySide2.QtCore
30  version_data['PySide2 module'] = True
31  version_data['PySide2 version'] = PySide2.__version__
32  # NOTE: if PyQt is loaded succesfully first, this may return a
33  # different version of Qt if the PySide2 Qt is different.
34  # it will just load the DLLs that it found.
35  version_data['PySide2 Qt version'] = PySide2.QtCore.__version__
36 except:
37  version_data['PySide2 module'] = False
38 
39 for key in sorted(version_data):
40  print key, version_data[key]