Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4328260
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:39:29+00:00 2026-05-21T09:39:29+00:00

I have a list created as self.statusListCtrl = wx.ListCtrl(self.panelUpper, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER) I add data

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:39:30+00:00Added an answer on May 21, 2026 at 9:39 am

    Use this to get Row x Column data:

    self.list.GetItem(row, col).GetText()
    

    Working example:

    import wx
    
    class MainWindow(wx.Frame):
        def __init__(self, *args, **kwargs):
            wx.Frame.__init__(self, *args, **kwargs)
            self.panel = wx.Panel(self)
    
            self.list = wx.ListCtrl(self.panel, style=wx.LC_REPORT)
            self.list.InsertColumn(0, "Date")
            self.list.InsertColumn(1, "Action")
            self.list.InsertColumn(2, "Result")
    
            for a in range(5):        
                self.list.Append(["Date %d" % a, "Action %d" % a, "Result %d" % a])
    
            self.sizer = wx.BoxSizer()
            self.sizer.Add(self.list, proportion=1, flag=wx.EXPAND)
    
            self.panel.SetSizerAndFit(self.sizer)
            self.Show()
    
            # Save
            for row in range(self.list.GetItemCount()):
                print(", ".join([self.list.GetItem(row, col).GetText() for col in range(self.list.GetColumnCount())]))
    
    app = wx.App(False)
    win = MainWindow(None)
    app.MainLoop()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list ctrl box and I populate it with data. self.listView1.Append([sFilename,sTitle,sArtist,sAlbum,sDestDir]) I
We have created a new List View Style that shows thumbnails from a picture
I have created a dynamic list picker script using Jquery 1.3 and PHP that
I have implemented a linked list as a self-referencing database table: CREATE TABLE LinkedList(
I have a list of textboxes created dynamically accroding to the user selection on
I have created a list view that displays the names and dates of items
I have a select list I've created in a form alter, however, when I
I have a gridview and in that gridview i created a list of imagebuttons
i have a unordered list of links, which are dynamically created by Ajax, and
I have created a nested list with drag/drop functionality. My issue is that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.