推荐 最新
momo

pyqt使用process和pipe打开nginx,我就是想实现xampp类似功能或者phpstudy,如何实现?

pyqt使用process和pipe打开nginx,但是nginx是长期运行的 如何解决,我就是想实现一点击按钮运行nginx,再点击就停止 "image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241215/af86e82a41c5848bb76e98c7e758171c.png)

0
1
0
浏览量11
喵酱魔法师

怎么构建一个QApplication实例,项目启动时先让他先运行起来,但是不显示任何窗口,然后能通过websocket发的请求参数调用,可以多次重复显示不同窗口?

class MyApp(QApplication): instance = None @staticmethod def getInstance(): if MyApp.instance is None: MyApp.instance = MyApp(sys.argv) return MyApp.instance class WindowManager(QObject): def __init__(self): super().__init__() self.currentWindow = None @Slot(str) def handleRequest(self, requestType, app, **kwargs): if requestType == "idcard": self.currentWindow = IdCardView() elif requestType == "keypad": self.currentWindow = KeyPadView(kwargs.get("flag")) elif requestType == "financeIcCard": self.currentWindow = FinanceIcCardView() elif requestType == "mockMagnetIC": self.currentWindow = MagneticView() self.currentWindow.ui.show() app.exec() return self.currentWindow.getData() def run_app(windowType, **kwargs): app = MyApp.getInstance() windowManager = WindowManager() return windowManager.handleRequest(windowType, app, flag=kwargs.get("flag")) 想通过run()方法传入不同的参数,根据参数调用对应的窗口且返回数据,但是这里会阻塞,请问这个可以怎么改造

0
1
0
浏览量12