#!/usr/bin/python3 import sys from PyQt5.QtWidgets import QApplication from PyQt5.QtCore import QUrl from PyQt5.QtQml import QQmlApplicationEngine if __name__ == '__main__': app = QApplication(sys.argv) # Create a component factory and load the QML script. engine = QQmlApplicationEngine() engine.load(QUrl('BuggyWindow.qml')) if not engine.rootObjects(): print("Failed to load QML file") sys.exit(1) sys.exit(app.exec_())