2024-10-01 11:40:07 发布
网友
我想运行一个exe(例如计算.exe或者命令提示符)在pythongui中(python2.7 | Windows | PyQt)。 有人知道我怎么做吗? (类似这样:https://www.youtube.com/watch?v=N6GWgxEvibE)
提前谢谢大家。在
import subprocess import time import win32gui ... def initUI(self): # create a process exePath = "C:\\Windows\\system32\\calc.exe" subprocess.Popen(exePath) hwnd = win32gui.FindWindowEx(0, 0, "CalcFrame", "计算器") time.sleep(0.05) window = QWindow.fromWinId(hwnd) self.createWindowContainer(window, self) self.setGeometry(500, 500, 450, 400) self.setWindowTitle('File dialog') self.show() ...
结果:
丢失exe'菜单
结果:
丢失exe'菜单
相关问题 更多 >
编程相关推荐