[问题] 为什么有动作,但还是空白

楼主: euser1777 (YY)   2022-02-01 18:06:22
以下附上我的code
https://gist.github.com/cj044/279f792a216ee82b25d47cfd28fdda88
还有CSV 档案
https://gist.github.com/cj044/8bb2ece639dae63fc59fa9dcce4e1716
https://github.com/cj044/VIP-HW (UI档案)
Q1:
比较有问题的是 47 ~ 60
def All_class(self): #读取全部的学生名单,存在列表里
.....................
self.ui.listView1.setModel(qlist)
每次build
https://imgur.com/U3QMTlr
Q2:
再来debug的时候 看到 https://imgur.com/1WvkoK7
实在看不懂橘色框框的东西 self : < __main ___
这样无助于我解bug
Q3:
Gituub All gists 的两个档案
https://gist.github.com/cj044/279f792a216ee82b25d47cfd28fdda88
还有CSV 档案
https://gist.github.com/cj044/8bb2ece639dae63fc59fa9dcce4e1716
该如何跟
https://github.com/cj044/VIP-HW
放在同一个资料档?
解了三天,google python qlist = QStringListModel() 还是无解?
只得到这个 https://its401.com/article/LaoYuanPython/104050416
谢谢!
作者: lycantrope (阿宽)   2022-02-01 20:18:00
54行 必须是self.class_info.extend(row)你也搞错append的用法
作者: ddavid (谎言接线生)   2022-02-02 04:16:00
Google list.append 跟 list.extend 就有了啊?不然就直接看官方文件里面 list 的部份啊要更明显两者比较的文章也很容易找啊,例如:https://bit.ly/3GjtpNR
作者: leolarrel (真.粽子无双)   2022-02-02 10:41:00
你还在五年前那家公司吗?
作者: lycantrope (阿宽)   2022-02-02 10:52:00
问题是Qstringlist只读List[str] 但在row in rows 的loop中 row是list[str] 直接append会变成list[list]所以我才说你要改成extend(row) 原始的code则是逻辑不通,才建议你看一下append怎么用..

Links booklink

Contact Us: admin [ a t ] ucptt.com