How to use python and windows com in pyramid (threads)?
Question: I'm connecting to MS Word by win32com.client.Distpatch function and on the
second request i've got error: 'CoInitialize has not been called.' I've found
this topic:

<http://www.velocityreviews.com/forums/t328097-coinitialize-error-when-using-
adodbapi.html>

and got that I have to call of CoInitialize in new thread. So question is
where to call CoInitialize function in pyramid.


Answer: So i added call of CoInitialize in function:

    
    
    @subscriber(NewRequest)
    def new_request_subscriber(event):
        import pythoncom
        pythoncom.CoInitialize()
    

and works without exception.

