Python Forum
How do you wait for a daemon to reach a certain state with subprocess.popen()?
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do you wait for a daemon to reach a certain state with subprocess.popen()?
#1
Hello All,
I am trying to launch a daemon using subprocessor.Popen(), the daemon runs for about 30 seconds until it reaches a steady state.  My question is how can I determine it has reached the steady state before continuing my python execution?  
The daemon stops printing to screen once it has reached a steady state.  
Any help is appreciated, I don't have to use Popen if there are other better options.
Thanks!

try:
     p = subprocess.Popen(exe_path)
     #wait until it reaches steady state
     do_stuff()
except subprocess.CalledProcessError as e:
    print(e)
finallly:
    p.kill()
Reply


Messages In This Thread
How do you wait for a daemon to reach a certain state with subprocess.popen()? - by phalse - Jul-07-2017, 02:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Information subprocess.Popen() suddenly giving me grief? davecotter 3 637 Dec-13-2023, 10:49 PM
Last Post: davecotter
  Use subprocess.Popen and time.sleep chucky831 2 1,964 Aug-11-2022, 07:53 PM
Last Post: carecavoador
  Wait til a date and time KatManDEW 2 1,450 Mar-11-2022, 08:05 PM
Last Post: KatManDEW
  wait for the first of these events Skaperen 4 1,994 Mar-07-2022, 08:46 PM
Last Post: Gribouillis
  how to do a two-way wait Skaperen 2 1,277 Mar-04-2022, 02:31 AM
Last Post: Skaperen
  Subprocess.Popen() not working when reading file path from csv file herwin 13 15,176 May-07-2021, 03:26 PM
Last Post: herwin
  Did subprocess.Popen() causes main routine to pause stdout? liudr 4 3,672 May-04-2021, 08:58 PM
Last Post: liudr
  disable subprocess.popen prompt echo paul18fr 1 2,031 Feb-04-2021, 02:50 AM
Last Post: Larz60+
  I have an index error inline 76 but I write the program in a way that cant reach tha abbaszandi 2 2,085 Nov-13-2020, 07:43 AM
Last Post: buran
  how to pass the interactive string to Popen subprocess maiya 1 1,896 Sep-18-2020, 09:36 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020