Get text from qtextedit and assign it to a variable

岁酱吖の 提交于 2019-11-28 14:27:56

QTextEdit does not have any text() method, if you want to get the text you must use toPlainText(), if you want to clean the text it is better to use clear() since it makes it more readable.

def search(self):
    textboxValue = self.textbox.toPlainText()
    for pid in psutil.pids():  # Controlla se il processo è attivo
        listapid = psutil.Process(pid)
        if listapid.name() == textboxValue:
            print('Processo trovato')
    self.textbox.clear()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!