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

  • Home
  • SEARCH
  • 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 9250937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:34:18+00:00 2026-06-18T10:34:18+00:00

I am trying to pass a counter from a python COM thread back into

  • 0

I am trying to pass a counter from a python COM thread back into a wxpython tabpanel. Anyone have a solution that would work. Some of my code below:

This class is seperate from my wxPython code but is called out and data sent to this thread.

class Log_COM_thread(Thread):
............
def run(self):
.............
int_log_cnt = int_log_cnt + 1
int_log.TabPanel.gauge.SetValue(int_log_cnt)
if int_log_cnt == 64:
int_log.TabPanel.Int_Log_Status.SetLabel('Extraction Complete')

The seperate module, int_log, this counter value is being sent to is called out like this:

class TabPanel(wx.Panel):
def __init__(self, parent):
self.gauge = wx.Gauge(self, range=72, size=(250, 25))
.....and then more wxpython code.

The error I run into is:

Exception in thread Thread-8:
Traceback (most recent call last):
File "F:\Python27\lib\threading.py", line 551, in __bootstrap_inner
self.run()
File "F:\Documents and Settings\swhite\Desktop\OG GUI Working Jan 13\nbm.py", line 267, in run
int_log.TabPanel.gauge.SetValue(int_log_cnt)
AttributeError: type object 'TabPanel' has no attribute 'gauge'

How would I send my counter back to that gauge in wxpython from my external thread. Any help in direction of how to do this would be extremely helpful.

  • 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-06-18T10:34:19+00:00Added an answer on June 18, 2026 at 10:34 am

    You cannot call wx methods directly from a separate thread. You need to use one of wxPython thread-safe methods to communicate back to the main GUI thread. They are wx.CallAfter, wx.CallLater and wx.PostEvent.

    There is lots of information on threads and wx on the wxPython wiki. I also wrote a tutorial on the subject that might help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to pass a variable into awk from user input: Have tried variations of
I am trying pass an enum into a method, iterate over that enums values,
I'm trying to pass a counter variable that I made in my PHP script
Im trying to pass some values into a text box from a child page
I'm trying to pass a counter as a value to one of the attributes
trying to pass in data from a file as a cmd line argument in
I trying to pass a Perl script over SSH that takes arguments. I works
I'm trying to pass a vector into the last argument of glDrawElements(). If I
I'm trying to pass an array into a custom class for storage and further
I am trying pass a .png image from the console in matlab to a

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.