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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:15:49+00:00 2026-06-05T07:15:49+00:00

The basic task I need to do is call a python script multiple times,

  • 0

The basic task I need to do is call a python script multiple times, each time with a different argument. For example:

script.py -t command1
script.py -t command2
script.py -t command3

Etc. Now the problem is that script.py takes a long time to run, so just putting the above in a shell script and running them in series (one after another) is a waste of time.

Instead what I’d like to be able to do is open up multiple terminals, and in each one, run

script.py -t command_i

For the ith command argument. Is there any way of doing this? If not, are there any other helpful parallel options for what I’m trying to do?

Cheers

EDIT – just realized: I probably want some sort of forking, yes? I’ve never done that with shell scripting though.

  • 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-05T07:15:50+00:00Added an answer on June 5, 2026 at 7:15 am

    To run a command in the background, add an & at the end:

    script.py -t command1 &
    script.py -t command2 &
    script.py -t command3 &
    

    If you are using this in a shell script and want to wait for all the processes to finish, run wait without arguments. It will wait for all background jobs in the current shell to complete before continuing the script.

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

Sidebar

Related Questions

I have some visual basic script code in my installer and i need to
The trivial task became really time consuming for me. I am doing really basic
I have some basic idea on how to do this task, but I'm not
I need to execute basic queries on a text file which consists of several
I need to access some functions in multiple controllers in a CodeIgniter application. At
This is probably a truly basic thing that I'm simply having an odd time
I want some advice on structuring some (basic) php code. I need to display
This seems like a really basic task, but after a lot of searching and
I am creating a basic data transfer task using TSQL where I am retrieving
I have a very basic understanding of shell scripting, but what I need to

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.