Mokus
Mokus

Reputation: 10400

How can I convert a gtk.ListStore to list?

I have a GUI with a gtk.TreeView and I would like to convert the gtk.ListStore to python list, how can I do that?

Upvotes: 1

Views: 802

Answers (2)

Galtkaam
Galtkaam

Reputation: 11

I think a more neat implementation would be:

list_store_data = [list(row) for row in list_store]

Upvotes: 0

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262919

You can use nested list comprehensions:

rowList = [column for column in [row for row in yourListStore]]

Upvotes: 1

Related Questions