Try something like this # Create the wrapper in the comtypes.gen package, it will be named # AGCoreLib; the name is derived from the 'library ' statement # in the IDL file if not (hasattr(sys, "frozen") or "python25.zip" in __file__): # pathname of the type library file tlbfile = os.path.join(os.path.dirname(__file__), "lilw.tlb") # if running as frozen app (dll or exe), the wrapper should be in # the library archive, so we don't need to generate it. comtypes.client.GetModule(tlbfile)
# Import the wrapper from comtypes.gen import AGCoreLib -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kelie Sent: Tuesday, July 29, 2008 1:28 PM To: comtypes-users@lists.sourceforge.net Subject: [comtypes-users] problem after packaging with py2exe Hello, I wrote a simple script which uses comtypes. When I run it the first time, it takes some time to generate the module(s) (in the comtypes/gen directory), which is normal. When I run the code again, the step of generating module(s) is skipped. But after I package the program into an executable with py2exe, it re-generates the module(s) every time I run the exe. Apparently it is not the case using PyWin32, or at least I cannot notice the delay. I'm not sure if this is related to its dynamic IDispatch feature that Michael mentioned in this post: http://article.gmane.org/gmane.comp.python.comtypes.user/192. Anyway is there a way to get around this? Thanks for your input! ------------------------------------------------------------------------ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ comtypes-users mailing list comtypes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/comtypes-users ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ comtypes-users mailing list comtypes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/comtypes-users