I would put the code below in a module in web2py/ and from the module import serv in your apps.
On Sep 10, 7:16 am, tvw <[email protected]> wrote: > Hi, > I've been trying to use win32com with web2py to get data from an > external process. I have been using the following in a controller for > my app (default.py) > > import win32com.client > serv = win32com.client.Dispatch("MyService") > > Once I installed web2py source this worked fine, however sometimes it > seems to try to create a second instance of the com connection to my > service which then fails (in another thread ?) as only one can exist > at a time. > > I would like to create only one instance of the com connection when > web2py starts and then share that with all applications. My question > is where should I put the above lines in web2py so that the com > connection is shared between apps and how should the instance be > referenced from each app. > > I hope I have made sense here. Please let me know if anyone can help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

