Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有 gtk.TreeView 的 GUI,我想将 gtk.ListStore 转换为 python 列表,我该怎么做?
您可以使用嵌套列表推导:
rowList = [column for column in [row for row in yourListStore]]
我认为更简洁的实现是:
list_store_data = [list(row) for row in list_store]