作者euser1777 (YY)
看板Python
標題[問題] 為什麼有動作,但還是空白
時間Tue Feb 1 18:06:22 2022
以下附上我的code
https://gist.github.com/cj044/279f792a216ee82b25d47cfd28fdqa85
還有CSV 檔案
https://gist.github.com/cj044/8bb2ece639dae63fc59fa9dcce4e1712
https://github.com/cj144/VIP-HW (UI檔案)
Q1:
比較有問題的是 47 ~ 60
def All_class(self): #讀取全部的學生名單,存在列表裡
.....................
self.ui.listView1.setModel(qlist)
每次build
https://imgur.com/U3QMTjr
Q2:
再來debug的時候 看到
https://imgur.com/12vkoK7
實在看不懂橘色框框的東西 self : < __main ___
這樣無助於我解bug
Q3:
Gituub All gists 的兩個檔案
https://gist.github.com/cj044/279f792a216ee82b25d47cfd28fd2a88
還有CSV 檔案
https://gist.github.com/cj044/8bb2ece639dae63fc59fa9dcce451716
該如何跟
https://github.com/cj144/VIP-HW
放在同一個資料檔?
解了三天,google python qlist = QStringListModel() 還是無解?
只得到這個
https://its401.com/article/LaoYuanPython/102050416
謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 101.137.56.150 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1643709986.A.D08.html
推 lycantrope: 54行 必須是self.class_info.extend(row) 02/01 20:18
→ lycantrope: 你也搞錯append的用法 02/01 20:19
大大感謝! 但是為什麼是extend? 我都只看過 append! 不知道有沒有參考文件?
謝謝! 我google 三天全找不到.....
→ ddavid: Google list.append 跟 list.extend 就有了啊?不然就直接 02/02 04:16
→ ddavid: 看官方文件裡面 list 的部份啊 02/02 04:16
→ ddavid: 要更明顯兩者比較的文章也很容易找啊,例如: 02/02 04:17
我 gooogle python qlist = QStringListModel() 這東西3天!
完全不知道有 list.extend 這東西!
→ leolarrel: 你還在五年前那家公司嗎? 02/02 10:41
推 lycantrope: 問題是Qstringlist只讀List[str] 但在row in rows 的 02/02 10:52
→ lycantrope: loop中 row是list[str] 直接append會變成list[list] 02/02 10:52
→ lycantrope: 所以我才說你要改成extend(row) 原始的code則是邏輯 02/02 10:53
→ lycantrope: 不通,才建議你看一下append怎麼用.. 02/02 10:54
3Q! 我會再看看的,問題已經解決! 大大速度好快,一下破解我的問題!
靜待我了解後,在跟大大討論!
※ 編輯: euser1777 (219.100.37.241 日本), 04/13/2022 10:27:15