an example Re: Connecting to running win32com server

Mark Hammond MarkH at ActiveState.com
Wed Oct 11 19:29:25 EDT 2000


"Alex Martelli" <aleaxit at yahoo.com> wrote in message
news:8s1d5002ikb at news1.newsguy.com...

> So, your problem is probably related to actually having
> multiple instances (within the same Python process!), not,
> as it seemed to you, to having multiple processes.

Correct.  Only one process, but multiple objects being served up from
it.

>
> Here's a test you can try.  Go to the win32com/servers
> directory and copy, for example, dictionary.py to a file
> named shareddictionary.py in the same directory.  Then,
> do the following changes:

...

FWIW, this is also how I recommend implementing "singletons" in
pythoncom - basically you create a single Python instance that does
the real work - your multiple COM objects simply delegate to the real
Python object.  So although you technically still have multiple COM
objects floating around, they all reference the same "real object"
doing the work.

Mark.





More information about the Python-list mailing list