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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:23:00+00:00 2026-05-30T12:23:00+00:00

Sorry if this question has been asked 100 times before, unfortunately, i haven’t found

  • 0

Sorry if this question has been asked 100 times before, unfortunately, i haven’t found it if it was. I am looking to write a python script which will spawn a background process and monitor it to see if it has completed. I have seen the os.system command which is now recommended to utilize subprocess.call, but this seems to block the program until the process completes.

My end goal is to have the following:

1) Program runs and starts processessing sing information

2) Halfway through the program it will start a Windows DOS program which will need to run simultaneously

3) Program continues to run and keeps processing data.

4) Program monitors the DOS program and when it exits and then sends final information. But the DOS program must have exited for it to run this step.

If someone could point me in the right direction that would be great.


More info: I am trying to utilize the python processor built into Securecrt. It appears to open the CMD window fine for the program, but it does not print out any of the middle commands (just enable’s in this example) until i kill the subprocess.

import os

import subprocess


def Main()

    crt.Screen.Synchronous = True

    VMCOMMAND = '\"C:\\Program Files\\VMWare\\VMware OVF Tool\\ovftool.exe\" ' + '--name=test' + ' C:\\temp\\test.ova' + ' vi://root:test@1.1.1.1'

    from subprocess import Popen


    p = Popen(VMCOMMAND)

    crt.Screen.Send(chr(13))
    crt.Screen.Send("enable" + chr(13))
    crt.Screen.Send("enable" + chr(13))
    crt.Screen.Send("enable" + chr(13))
    crt.Screen.Send("enable" + chr(13))


    returncode = p.wait()

    crt.Screen.Send("should not see enable" + chr(13))

Main ()
  • 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-30T12:23:01+00:00Added an answer on May 30, 2026 at 12:23 pm

    Use Popen constructor:

    from subprocess import Popen
    
    # start program
    p = Popen(["program.exe", "arg1"])
    # do other stuff here
    # ...
    # at the end wait for the program to exit
    returncode = p.wait()
    # run final step here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sorry if this question has been asked before, I've tried googling/looking on here/browsing
I know this has been asked 100 times before but every bit of code
Sorry if this question has been asked before. On my search through SO I
Sorry I know this question has probably been asked before, but do you know
sorry if this question has been asked before, I searched but wasn't sure on
So, if this question has been asked before, I'm sorry. I'm not exactly sure
I'm sorry if this question has been asked before, but I can't seem to
I know that this question has been asked many times before in different guises
I'm new to this, so sorry if my question has been asked before. I
I am sorry if this question has been asked before (I tried to find

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.