# -*- coding: utf-8 -*-
from PyQt5 import QtWidgets
import sys

app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QWidget()
window.setWindowTitle("Полупрозрачное окно")
window.resize(300, 100)
window.setWindowOpacity(0.5)
window.show()
print(window.windowOpacity()) # Выведет: 0.4980392156862745
sys.exit(app.exec_())
8f583f0f06752c782078497e53b79a223e6d9558
<mask token>

<mask token>
window.setWindowTitle('Полупрозрачное окно')
window.resize(300, 100)
window.setWindowOpacity(0.5)
window.show()
print(window.windowOpacity())
sys.exit(app.exec_())

<mask token>
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QWidget()
window.setWindowTitle('Полупрозрачное окно')
window.resize(300, 100)
window.setWindowOpacity(0.5)
window.show()
print(window.windowOpacity())
sys.exit(app.exec_())

from PyQt5 import QtWidgets
import sys
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QWidget()
window.setWindowTitle('Полупрозрачное окно')
window.resize(300, 100)
window.setWindowOpacity(0.5)
window.show()
print(window.windowOpacity())
sys.exit(app.exec_())

# -*- coding: utf-8 -*-
from PyQt5 import QtWidgets
import sys

app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QWidget()
window.setWindowTitle("Полупрозрачное окно")
window.resize(300, 100)
window.setWindowOpacity(0.5)
window.show()
print(window.windowOpacity()) # Выведет: 0.4980392156862745
sys.exit(app.exec_())