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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:47:00+00:00 2026-05-11T09:47:00+00:00

Given the Python documentation for Thread.run() : You may override this method in a

  • 0

Given the Python documentation for Thread.run():

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

I have constructed the following code:

class DestinationThread(threading.Thread):     def run(self, name, config):         print 'In thread'  thread = DestinationThread(args = (destination_name, destination_config)) thread.start() 

But when I execute it, I receive the following error:

Exception in thread Thread-1: Traceback (most recent call last):   File '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py', line 522, in __bootstrap_inner     self.run() TypeError: run() takes exactly 3 arguments (1 given) 

It seems I am missing something obvious, but the various examples I have seen work with this methodology. Ultimately I am trying to just pass the string and dictionary into the thread, if the Constructor is not the right way, but rather to make a new function to set the values prior to starting the thread, I am open to that.

Any suggestions on how to best accomplish this?

  • 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. 2026-05-11T09:47:00+00:00Added an answer on May 11, 2026 at 9:47 am

    You really don’t need to subclass Thread. The only reason the API supports this is to make it more comfortable for people coming from Java where that’s the only way to do it sanely.

    The pattern that we recommend you use is to pass a method to the Thread constructor, and just call .start().

     def myfunc(arg1, arg2):      print 'In thread'      print 'args are', arg1, arg2   thread = Thread(target=myfunc, args=(destination_name, destination_config))  thread.start() 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 219k
  • Answers 219k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The problem is that when you bind that autocomplete it's… May 12, 2026 at 11:51 pm
  • Editorial Team
    Editorial Team added an answer Why not replace the oldest ad click? So rather than… May 12, 2026 at 11:51 pm
  • Editorial Team
    Editorial Team added an answer Possibly a certificate related issue. Check if there are any… May 12, 2026 at 11:51 pm

Related Questions

Python does not print traceback messages from exceptions raised in daemon threads. For example,
It seems like Groovy was forgotten in this thread so I'll just ask the
I was looking at the builtin object methods in the Python documentation , and
For some reason, the following seems to work perfectly on my ubuntu machine running

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.