blocking a program until a non-Python process terminates

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Earl Eiland

    #1

    blocking a program until a non-Python process terminates

    I'm running an .exe in Python, using subProcess.Pope n. The executable
    writes data to a file I process later on in the program. Unfortunately,
    my program returns the error "no such file...". How do I block
    execution until the external executable terminates?

    Earl

  • Michael Hoffman

    #2
    Re: blocking a program until a non-Python process terminates

    Earl Eiland wrote:[color=blue]
    > I'm running an .exe in Python, using subProcess.Pope n. The executable
    > writes data to a file I process later on in the program. Unfortunately,
    > my program returns the error "no such file...". How do I block
    > execution until the external executable terminates?[/color]

    Either:

    1)

    returncode = subprocess.call (cmdline)

    2) or:

    pipe = subprocess.Pope n(cmdline)
    returncode = pipe.wait()
    --
    Michael Hoffman

    Comment

    Working...