我必须用Gtk
做一个应用程序,我想用ListStore
来表示列中的一些数据。但是当我尝试插入时,我得到了这个错误。你知道吗
File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 862, in _convert_row
raise ValueError('row sequence has the incorrect number of elements')
ValueError: row sequence has the incorrect number of elements
我的数据类型是string string string
(因为图像像mongodb
上的string
一样保存),最后一个是列表
我试着用这个表格插入:
store = Gtk.ListStore(GObject.TYPE_PYOBJECT,str, str, str, str)
我在网上读到,我可以插入一个类似GObject.TYPE_PYOBJECT
的列表,但我不明白。你知道吗
对于附加数据,我执行以下操作:
def v_show(self, dic):
for item in dic:
name = item["name"]
aux = ''.join(item["description"])
description = aux
image = item["image"]
exercises = item["exercises"]
data = [name, description, image, exercises]
self.store.append(data)
目前没有回答
相关问题 更多 >
编程相关推荐