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
Nepheshel
V2EX  ›  Python

pyqt5 一运行程序 UI 就崩溃 显示 Python 停止运行

  •  
  •   Nepheshel · 2018-06-22 18:10:23 +08:00 · 3030 次点击
    这是一个创建于 2125 天前的主题,其中的信息可能已经有所发展或是发生改变。
    部分代码:
    def retranslateUi(self, MainWindow):
    _translate = QtCore.QCoreApplication.translate
    MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
    self.label.setText(_translate("MainWindow", "输入验证码"))
    self.label_5.setText(_translate("MainWindow", "获取验证码"))
    self.pushButton_2.setText(_translate("MainWindow", "确定"))
    self.label_7.setText(_translate("MainWindow", "结果"))
    self.pushButton.setText(_translate("MainWindow", "开始生成报表"))
    self.pushButton.clicked.connect(self.on_click_1)

    def on_click_1(self):
    self.withoutCookieLogin(driver,url_login)

    on_click_1 只要一执行 withoutCookieLogin(driver,url_login) UI 就崩溃
    执行其他的 比如 UI 内部程序 self.label_2.setText('请输入验证码') 就没影响
    求大手子指教
    ilucio
        1
    ilucio  
       2018-06-23 10:54:40 +08:00
    定义 on_click_1 函数时需要传入 driver,url_login 的参数吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3637 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 10:53 · PVG 18:53 · LAX 03:53 · JFK 06:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.