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 8675959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:04:30+00:00 2026-06-12T20:04:30+00:00

I’m attempting to thread some gui code to get rid of the lag in

  • 0

I’m attempting to thread some gui code to get rid of the lag in a combo box. The option the user selects does a bit of web scraping in the background, and depending on which option they select, the lag can sometimes be substantial as the program seeks the data it needs.

For the docs, it seems that to start a thread, I only need call threading.Thread with the appropriate arguments. So, my attempt of this in code is as follows:

def EvtComboBox(self, event):
    self.statusBox.AppendText('Fetching ' + event.GetString() + ' data.\n')
    loadingThread = threading.Thread(target=self.doStuff(event), name='i_am_a_thread')
    loadingThread.start()
    threading.Thread(target=self.checker(loadingThread)).start()

def doStuff(self, event):
    self.statusBox.AppendText(event.GetString() + ':\n')        
    self.assets = self.scraper.loadConferencePage(event.GetString())
    self.statusBox.AppendText(str(self.scraper.getNumOfNewHandouts(self.assets)) + ' new handout(s) in Asset Manager\n' + 
                                '-------------------------\n\n')

def checker(self, loadingThread):
    while threading.Thread.isAlive(loadingThread):
        print True

The behavior I’m expecting is that the loadingthread starts, and begins fetching the data it needs from the web. While it is doing that, I thought the second thread I create, would monitor that first thread, and my final assumption was that since those two threads are running “concurrently”, the EvtComboBox method would finish, and the combobox in the gui would close.

However, none of that happens. The EvtComboBox method fires, and then the code seems to run completely sequentially. If I stick a print statement below the two threads (just to see when it gets executed,

def EvtComboBox(self, event):
    self.statusBox.AppendText('Fetching ' + event.GetString() + ' data.\n')
    loadingThread = threading.Thread(target=self.doStuff(event), name='i_am_a_thread')
    loadingThread.start()
    threading.Thread(target=self.checker(loadingThread)).start()
    print 'EvtComboBox method finished'

It only gets executed after the code the threads call gets run… so.. I’m unsure why it is behaving in this manner.

Why isn’t it executing concurrently?

  • 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-12T20:04:31+00:00Added an answer on June 12, 2026 at 8:04 pm

    In the target part of threading.Thread you should not be calling the function, instead you give it the function object and arguments; such as threading.Thread(target=self.checker args=loadingThread).start()

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I need to clean up various Word 'smart' characters in user input, including but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.