pythonconsolewidget.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Mac-Python-3.X 作者: L1nwatch 项目源码 文件源码
def execute(self):

        # Define this here to give users something to look at.
        qApp = QApplication.instance()

        self.expression = self.text()
        try:
            result = str(eval(str(self.expression)))

            # Emit the result of the evaluated expression.
            self.pythonOutput.emit(result)

            # Clear the line edit, append the successful expression to the
            # history, and update the current command index.
            self.clear()
            self.history.append(self.expression)
            self.current = len(self.history)
        except:
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号