0

I am using windows 7 and python 2.7

There is process-A.

process-B which is launched through custom url.

My app starts through process-A and it opens a webpage in browser. This page does necessary authentication of user and this finally redirect to a url which launches process-B through custom url aligned to it.

When process-B exits(either success or exception), then process-A should proceed further i.e. process-A should opens a webpage, then it should wait till process-B is finished, and then continue further.

So, how process-A know whether process-B is finished or not, i.e. how to define its waiting period.

imp
  • 1,967
  • 2
  • 28
  • 40

1 Answers1

0

You can open a thread in process-A to check if process-B has been started with a simple while loop. Once process-B is started, you can break the loop and invoke any function you want. With 3pp party wmi, you will be able to know status of process-B. For example:

#!/usr/bin/env python
#-*- coding:utf-8 -*-

import wmi

c = wmi.WMI()

for process in c.Win32_Process():

    # do whatever you want with process
    print 'this is process: ', process
Stephen Lin
  • 4,852
  • 1
  • 13
  • 26