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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:32:07+00:00 2026-05-25T13:32:07+00:00

I am executing a command in a thread for almost 25k times like if

  • 0

I am executing a command in a thread for almost 25k times like

if threaded is True:
                thread = Thread(target=threadedCommand, args=(cmd))
                thread.start()
                thread.join()  

def threadedCommand(command):
    if command is None:
        print 'can\'t execute threaded command'
        sys.exit(-1)
    print 'executing - %s'%(command)
    os.system(command)  

and command is like

cp file dir

and what I see is

Traceback (most recent call last): File
“/usr/lib64/python2.6/threading.py”, line 525, in __bootstrap_inner
self.run() File “/usr/lib64/python2.6/threading.py”, line 477,
in run
self.__target(*self.__args, **self.__kwargs) TypeError:
threadedCommand() takes exactly 1 argument (52 given)

^CException in thread Thread-9377: Traceback (most recent call last):
File “/usr/lib64/python2.6/threading.py”, line 525, in
__bootstrap_inner
self.run() File “/usr/lib64/python2.6/threading.py”, line 477,
in run
self.__target(*self.__args, **self.__kwargs) TypeError:
threadedCommand() takes exactly 1 argument (56 given)

  • 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-25T13:32:07+00:00Added an answer on May 25, 2026 at 1:32 pm

    args must be a tuple. (cmd) is the same as cmd; you want a one-element tuple instead:

    thread = Thread(target=threadedCommand, args=(cmd,))
    #                                                ^
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Bash I'm executing a command and putting the result in a variable like
I need something like make i.e. dependencies + executing shell commands where failing command
I am executing a thread which invokes BCP out in command prompt using C#
I know that SqlContext.WindowsIdentity returns the current user that is executing the command (in
I have an awesome trouble with Gem. After executing this command: rm -f /usr/local/lib/ruby/gems/1.9.1/cache/*
I am executing a diff command in perl . my @lines = `/usr/local/bin/diff -udr
I cannot get the example Python programs to run. When executing the Python command
Below is the command I tried executing, without success: exec('ln -s ' . PLUGIN_DIR
Say I have a command line C program which is currently executing, and I
At a unix command line, what's the difference between executing a program by simply

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.