我用PYQT5和python3.6设计了一个应用程序,通过在“lineEdit”中写入进程名,然后按“kill”按钮来终止localhost中的进程。你知道吗
我想要的是通过先获取数据然后检查我想要终止的进程的名称来终止远程计算机中的进程!。你知道吗
有什么想法吗?你知道吗
提前谢谢。你知道吗
只在localhost中而不是在远程pc中终止进程的代码
def Process(self):
x=self.lineEdit.text()
self.textBrowser.clear()
for proc in psutil.process_iter():
if proc.name()==x:
proc.kill()
self.lineEdit.clear()
QMessageBox.information(self, "Success", x + " has been terminated")
return
for proc in psutil.process_iter():
if proc.name()!=x:
print(proc)
QMessageBox.information(self, "Error","The process " +x + " is not found")
return
目前没有回答
相关问题 更多 >
编程相关推荐