Last active
August 29, 2015 13:56
-
-
Save seanfisk/9194547 to your computer and use it in GitHub Desktop.
PySide Version Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Script to dump as much information as possible about the current platform, | |
# Python, PySide, and Qt. | |
# | |
# On platforms with wget, you may run with: | |
# | |
# wget -q -O - https://gist.githubusercontent.com/seanfisk/9194547/raw/pyside_version.py | python - | |
# | |
from __future__ import print_function | |
import sys | |
import platform | |
import PySide | |
def main(argv): | |
labels = [] | |
values = [] | |
labels.append('Platform') | |
values.append(platform.platform()) | |
labels.append('Specific platform info tuple') | |
specific_functions = { | |
'Windows': platform.win32_ver, | |
'Darwin': platform.mac_ver, | |
'Linux': platform.linux_distribution, | |
} | |
values.append(str(specific_functions[platform.system()]())) | |
labels.append('Python compiler') | |
values.append(platform.python_compiler()) | |
labels.append('Python version') | |
values.append('{0} {1}'.format( | |
platform.python_implementation(), platform.python_version())) | |
labels.append('PySide version') | |
values.append(PySide.__version__) | |
labels.append('PySide version tuple') | |
values.append(str(PySide.__version_info__)) | |
labels.append('Compiled with Qt') | |
values.append(PySide.QtCore.__version__) | |
labels.append('Running with Qt') | |
values.append(PySide.QtCore.qVersion()) | |
max_label_width = max([len(s) for s in labels]) | |
for label, value in zip(labels, values): | |
print((label + ': ').ljust(max_label_width + 2) + value) | |
return 0 | |
if __name__ == '__main__': | |
raise SystemExit(main(sys.argv)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment