Re: [问题] pyqt5 QTextBrower显示文字请益

楼主: kerycheng (kk)   2022-12-27 19:10:11
自问自答
https://ithelp.ithome.com.tw/articles/10274773
参考这篇的写法,多建一个start.py作为程式进入点
并且把原先放在scrape_ui.py的onButtobClick和display_text移去main_controller.py
除此之外scrape_shopee_controller.py的那些执行步骤也一并移去main_controller.py里

下面是改完之后的程式码
start.py
https://pastebin.com/XrJu1aCF
scrape_ui.py
https://pastebin.com/0pACvq9L
main_controller.py
https://pastebin.com/XtXQipvk
scrape_shopee_controller.py
https://pastebin.com/uFJ2itVY
scrape_ruten_controller.py
https://pastebin.com/kq4Qza3D
现在的UI接口
https://imgur.com/vJgIJbV.jpg
感觉main_controller还能写得更干净一点,不过现在能跑就好
作者: surimodo (好吃棉花糖)   2022-12-27 22:30:00
大师
作者: anticrime (黑熊)   2021-01-04 16:28:00
如果要干净一点的main_controll你可以试试看用signal去传值或是把main controll丢进去爬虫的class 就可以在各自的function里面写

Links booklink

Contact Us: admin [ a t ] ucptt.com