try: text = self.textBrowser.toPlainText() with open('log.txt','a+') as f: f.write(text) except Exception as e: print(e)
方法简单实用,而且在pyqt中使用控件点击保存log的时候,不会出现异常
try: text = self.textBrowser.toPlainText() with open('log.txt','a+') as f: f.write(text) except Exception as e: print(e)
方法简单实用,而且在pyqt中使用控件点击保存log的时候,不会出现异常