Python Forum
Use subprocess.Popen and time.sleep
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use subprocess.Popen and time.sleep
#1
Good morning everyone, I am new to Python. I am developing a script to automate a program I need at work. What I need to do via Python is simply open a program that is in the system. To do this I used subprocess.Popen()
The problem is that my script should not continue until the program has fully opened. How can I go about stopping the script? I have tried using time.sleep() but using this function seems to then fail to use subprocess.terminate() to close the program. Can you help me with this? Thanks
Reply
#2
How do you know the process has "fully opened"? I don't know what it means to be "fully opened".
Reply
#3
Hi,

Post some of your code and the error messages you are getting, so we can try tu understand better how to help you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a difference between Python’s time.sleep and win32api.Sleep? phpjunkie 4 1,069 Sep-21-2024, 05:17 PM
Last Post: aakritiintelligence
  Understanding subprocess.Popen Pedroski55 6 1,970 May-12-2024, 10:46 AM
Last Post: Pedroski55
Information subprocess.Popen() suddenly giving me grief? davecotter 3 1,779 Dec-13-2023, 10:49 PM
Last Post: davecotter
  How to immediately kill and restart a thread while using a time.sleep() inside it? philipbergwerf 4 5,197 Feb-07-2022, 04:16 PM
Last Post: Gribouillis
  Subprocess.Popen() not working when reading file path from csv file herwin 13 23,943 May-07-2021, 03:26 PM
Last Post: herwin
  Did subprocess.Popen() causes main routine to pause stdout? liudr 4 5,245 May-04-2021, 08:58 PM
Last Post: liudr
  Time.sleep: stop appending item to the list if time is early quest 0 2,374 Apr-13-2021, 11:44 AM
Last Post: quest
  disable subprocess.popen prompt echo paul18fr 1 3,020 Feb-04-2021, 02:50 AM
Last Post: Larz60+
  Can you end the Time.sleep function boier96 9 16,806 Jan-16-2021, 10:09 PM
Last Post: Serafim
  how to pass the interactive string to Popen subprocess maiya 1 2,578 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