I have a list created as
self.statusListCtrl = wx.ListCtrl(self.panelUpper, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
I add data to this list using
self.statusListCtrl.Append([datetime.datetime.now(),action,result])
When my process is all done I have a nice list showing things that were tried, the result of that attempt and a datetime stamp. Now what I want to do is output that to a text file. my problem is that I cant get the data from my listctrl correctly.
This is how I am trying to iterate through the list.
fileName = 'd:\ssplogs\sspInstaller.log'
FILE = open(fileName,"w")
for itemIdx in range(0,self.statusListCtrl.GetItemCount()):
line = str(self.statusListCtrl.GetItemText(itemIdx) + "\n")
print "line" , line
writeLine = line
FILE.write(writeLine)
FILE.close()
The output I am getting though is only my datetime stamp, which is the first column of my list. How do I get this so I see something like
datetime, action, result
Use this to get Row x Column data:
Working example: