Using wx.Config is very easy, just create config passing name of your app and add data e.g.
config = wx.Config("StackOverflowTest")
config.Write("testdata", "yes it works!")
Now you can read it anytime
config = wx.Config("StackOverflowTest")
print config.Read("testdata")
For saving list cntrl data I would suggest that you first read all data in a python list and pickle that list into config, next time read config, unpickle data and populate list, structure wise add functions like fillList/saveList so you can be sure reading writing part are nearby and similar.
e.g. you can use this skeleton
import wx
import cPickle
class MyListCtrl(wx.ListCtrl):
def __init__(self, *args, **kwargs):
wx.ListCtrl.__init__(self, *args, **kwargs)
self.config = wx.Config("MykoolApp")
self.fillist()
def filllist(self):
# load rows and check for error too, if no data
data = self.config.Read("list_cntrl_data")
rowList = cPickle.loads(data)
for row in rowList:
# add this row to list cntrl
pass
def savelist(self):
rows = []
for row in self:
# add data to rows
pass
data = cPickle.dumps(rows)
self.config.Write("list_cntrl_data", data)
def onchange(self):
"""
on changes to list e.g. add delete call save list
"""
self.savelist()