V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Va1n3R
V2EX  ›  Python

Pycharm 开发 PyQt5 项目的时候,有异常直接退出怎么破?

  •  
  •   Va1n3R · 2017-11-03 14:07:19 +08:00 · 1873 次点击
    这是一个创建于 2356 天前的主题,其中的信息可能已经有所发展或是发生改变。

    前几天接触了 PYQT5,发现调试特别不方便...遇到了异常直接返回一个地址然后退出..
    想知道除了 Logging,prin,还有断点 debug 之外有没有啥办法啊...

    这是主函数

    if __name__ == '__main__':
        '''
        主函数
        '''
     
        app = QApplication(sys.argv)
        mainWindow = QMainWindow()
        ui = Ui_mainWindow()
        ui.setupUi(mainWindow)
        mainWindow.show()
        sys.exit(app.exec_())
    
    3 条回复    2017-11-06 12:19:10 +08:00
    cyrbuzz
        1
    cyrbuzz  
       2017-11-05 13:01:27 +08:00
    在命令行运行可以捕获到错误信息。
    dancingbear
        2
    dancingbear  
       2017-11-06 10:48:09 +08:00
    try catch
    Va1n3R
        3
    Va1n3R  
    OP
       2017-11-06 12:19:10 +08:00
    @cyrbuzz 这个好用!感谢!!!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   966 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:30 · PVG 04:30 · LAX 13:30 · JFK 16:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.