作者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://webptt.com/cn.aspx?n=bbs/Python/M.1643709986.A.D08.html
1F:推 lycantrope: 54行 必须是self.class_info.extend(row) 02/01 20:18
2F:→ lycantrope: 你也搞错append的用法 02/01 20:19
大大感谢! 但是为什麽是extend? 我都只看过 append! 不知道有没有参考文件?
谢谢! 我google 三天全找不到.....
3F:→ ddavid: Google list.append 跟 list.extend 就有了啊?不然就直接 02/02 04:16
4F:→ ddavid: 看官方文件里面 list 的部份啊 02/02 04:16
5F:→ ddavid: 要更明显两者比较的文章也很容易找啊,例如: 02/02 04:17
我 gooogle python qlist = QStringListModel() 这东西3天!
完全不知道有 list.extend 这东西!
7F:→ leolarrel: 你还在五年前那家公司吗? 02/02 10:41
8F:推 lycantrope: 问题是Qstringlist只读List[str] 但在row in rows 的 02/02 10:52
9F:→ lycantrope: loop中 row是list[str] 直接append会变成list[list] 02/02 10:52
10F:→ lycantrope: 所以我才说你要改成extend(row) 原始的code则是逻辑 02/02 10:53
11F:→ lycantrope: 不通,才建议你看一下append怎麽用.. 02/02 10:54
3Q! 我会再看看的,问题已经解决! 大大速度好快,一下破解我的问题!
静待我了解後,在跟大大讨论!
※ 编辑: euser1777 (219.100.37.241 日本), 04/13/2022 10:27:15