如何在调用执行特定任务时生成子进程

2024-10-04 03:21:18 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨,我有一个子进程,我在我的代码调用这个子进程是Nasgro一个图形用户界面,我没有建立或代码知道我可以调用子进程没有问题,但我希望子进程执行一些功能,我不只是打开

  direction=QtGui.QFileDialog.getExistingDirectory(self,"Pick a folder")

     #looking for the exe of eCRPR
     for element in os.listdir(direction):
         if element.endswith('nasgro90.exe'):
             #creating a variable of name process and having type QProcess giving by Pyqt
             process =QProcess(self)
             # join the main path and the exe file so we can give it to subprocess.call
             path2=''.join((direction,'\\',element))
             #opining nasgro
             process.start(path2)

这就是我如何调用进程和GUI的显示方式(见图)GUI description here

我想要的是,当我调用子进程时,他不用我点击它就使用NASFLA(参见图2)enter image description here


Tags: andofthe代码selffor进程element