import PySide2.QtCore

# Prints PySide2 version
# e.g. 5.11.1a1
print(PySide2.__version__)

# Gets a tuple with each version component
# e.g. (5, 11, 1, 'a', 1)
print(PySide2.__version_info__)

# Prints the Qt version used to compile PySide2
# e.g. "5.11.2"
print(PySide2.QtCore.__version__)

# Gets a tuple with each version components of Qt used to compile PySide2
# e.g. (5, 11, 2)
print(PySide2.QtCore.__version_info__)

print(PySide2.QtCore.qVersion())

#!/usr/bin/env python3
# coding: utf-8

'''
PySide2
'''

import sys
try:
    import PySide2.QtCore
except ImportError:
    print('cannot load module: PySide2.QtCore')
    sys.exit(1)

# Prints PySide2 version
# e.g. 5.11.1a1
print(PySide2.__version__)

# Gets a tuple with each version component
# e.g. (5, 11, 1, 'a', 1)
print(PySide2.__version_info__)

# Prints the Qt version used to compile PySide2
# e.g. "5.11.2"
print(PySide2.QtCore.__version__)

# Gets a tuple with each version components of Qt used to compile PySide2
# e.g. (5, 11, 2)
print(PySide2.QtCore.__version_info__)

print(PySide2.QtCore.qVersion())

ADD try-except to handle import error