Having multiple instances of a single application start a single instance of another one

buffinator buffinator at mymail.com
Fri Feb 23 17:16:59 EST 2007


I have two applications that should work together, let's call them A and B.

The first time A starts, it should open a B process and start 
communicating with it. All other times an A instance starts it should 
simply talk with the B that already is open.

The problem here is, if I start say 40 A applications at once... how do 
I check if a B is open "fast enough" so that the other A's (not the 
first one) won't spawn new B's?

Im programming this in windows and am currently using the horrible 
solution in A

if not win32gui.FindWindow(None, "Name of B"):
	spawn_B_here()

This only works well if there is a small time between the A's started 
first...

What would the best solution for my problem be?

/buffis



More information about the Python-list mailing list