# pyqt5界面打開flash.swf文件 from PyQt5 import QtCore, QtGui, QAxContainer, QtWidgets class Ui_Flash(QAxContainer.QAxWidget): def __init__(self, parent=None): super(Ui_Flash, self).__init__() self.resize(800, 600) # 設置窗口的大小 self.setControl("{D27CDB6E-AE6D-11cf-96B8-444553540000}") # flash的com接口 self.dynamicCall("LoadMovie(long,string)", 0, r"C:\Users\ming\Desktop\aa\第二十章電與磁\4 電鈴-好.swf") #裝載swf文件 self.show() if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) ui = Ui_Flash() ui.show() sys.exit(app.exec_())