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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:13:22+00:00 2026-06-11T22:13:22+00:00

I had some annoyances with spawning subprocesses, like getting correct output and so on.

  • 0

I had some annoyances with spawning subprocesses, like getting correct output and so on. A wrapper library, envoy, solved all of my problems with an easy-to-use interface that gets rid of most problems.

Using thread, I sometimes struggle with hanging processes that does not end, external programs launched within threads that I can’t reach anymore and so on.

Is there any “threading for dummies” python library out there? Thanks

  • 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-11T22:13:24+00:00Added an answer on June 11, 2026 at 10:13 pm

    Is there any “threading for dummies” python library out there?

    No, there is not. threading is pretty simple to use in simple cases. You want to use it to introduce concurrency in your program. This means you want to use it whenever you want two or more actions to happen simultaneously, i.e. at the same time.

    This is how you can let Peter build a house and let Igor drive to Moskow at the same time:

    from threading import Thread
    import time
    
    def drive_bus():
        time.sleep(1)
        print "Igor: I'm Igor and I'm driving to... Moskow!"
        time.sleep(9)
        print "Igor: Yei, Moskow!"
    
    def build_house():
        print "Peter: Let's start building a large house..."
        time.sleep(10.1)
        print "Peter: Urks, we have no tools :-("
    
    threads = [Thread(target=drive_bus), Thread(target=build_house)]
    
    for t in threads:
        t.start()
    
    for t in threads:
        t.join()
    

    Isn’t that simple? Define your function to be run in another thread. Create a threading.Thread instance with that function as target. Nothing happend so far, until you invoke start. It fires off the thread and immediately returns.

    Before letting your main thread exit, you should wait for all the threads you have spawned to finish. This is what t.join() does: it blocks and waits for the thread t to finish. Only then it returns.

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

Sidebar

Related Questions

I had some problems with my subversion server and i had to restore it
We had some content restructure recently and I'd like to put in some redirect
I had some experience on programming languages like Java, C#, Scala as well as
I've had some problems using timeit() as an accurate benchmark when comparing longer (>
I had some fortran code that looked something like: subroutine foo(mx,my,mz) real pts(3,mx,my,mz) end
I had some problems figuring out a good title, but hopefully the code examples
I had some help in the past with getting the coordinates of a network
I had some problems after starting a new coredata project with the xcode 3.2.5...
I had some problems with vertical spacing in Firefox and IE for an embarrassingly
I've had some luck controlling processing.js sketches using html form elements and would like

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.