From norman at xsol.com Wed Aug 9 02:29:25 2017 From: norman at xsol.com (Norman Hadfield) Date: Wed, 9 Aug 2017 06:29:25 +0000 Subject: [python-win32] How to deploy pywin32 when using embedded instance of Python? Message-ID: Hi All, We currently use the standard Python and Pywin32 installers but to make our win32 application,) which uses Python to execute dynamically generated expressions including instantiating COM servers and hence the need to pywin32), easier to install and support multiple versions side by side etc we want to switch to using an embedded version installed in a sub-folder of our application. This will allow simple xcopy deployment plus allow us to package our application using project centennial as a Windows store App. I have a prototype that seems to work by just adding the whole of the "site-packages" folder to a lib folder under the embedded Python folder and adding the 'python\lib' 'python\lib\site-packages' 'python\lib\site-packages\pythonwin' 'python\lib\site-packages\win32' 'python\lib\site-packages\win32\lib' Folders to the Python path. 1. I now want to trim the pywin32 files down to the minimum so presumably I can just delete the pip*, pkg*, setuptools* folders and also the demo, test sub-folders, help files etc - is that correct? 2. As we don't need users to use pythonwin.exe presumably we could drop that folder as well? 3. I notice that two dlls get installed to C:\WINDOWS\SysWOW64 so I am planning to also include those within our application folders (I see they're also in site-packages/pywin32-system32 already) and add/modify appropriate manifest files to ensure they are found and loaded by Windows SXS. Does anyone see a problem with that? Thanks for any help, Norm. From timr at probo.com Wed Aug 9 14:19:15 2017 From: timr at probo.com (Tim Roberts) Date: Wed, 9 Aug 2017 11:19:15 -0700 Subject: [python-win32] How to deploy pywin32 when using embedded instance of Python? In-Reply-To: References: Message-ID: <81a1bb11-2333-e536-e520-58a7b15c9955@probo.com> Norman Hadfield wrote: > We currently use the standard Python and Pywin32 installers but to make our win32 application,) which uses Python to execute dynamically generated expressions including instantiating COM servers and hence the need to pywin32), easier to install and support multiple versions side by side etc we want to switch to using an embedded version installed in a sub-folder of our application. > > This will allow simple xcopy deployment plus allow us to package our application using project centennial as a Windows store App. This is EXACTLY what tools like py2exe and cx_Freeze and pyinstaller do. You don't need to reinvent this wheel. > 1. I now want to trim the pywin32 files down to the minimum so presumably I can just delete the pip*, pkg*, setuptools* folders and also the demo, test sub-folders, help files etc - is that correct? py2exe (and the rest) do that. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From cnkhanh1986 at gmail.com Sat Aug 26 02:47:12 2017 From: cnkhanh1986 at gmail.com (ng khanh) Date: Sat, 26 Aug 2017 01:47:12 -0500 Subject: [python-win32] get current COM static binding Message-ID: Hi, i want to check if have any current com connection dispatch created by win32com.client.gencache.EnsureDispatch('Excel.Application') or similar. Actually, i work with excel by jupyter so i need to catch and close any current excel dispatch created before in case i want to reset excel -------------- next part -------------- An HTML attachment was scrubbed... URL: From cristinabazzanella at ed-elettronica.it Thu Aug 31 08:44:23 2017 From: cristinabazzanella at ed-elettronica.it (Cristina Bazzanella) Date: Thu, 31 Aug 2017 14:44:23 +0200 Subject: [python-win32] Problem with "import gtk" Message-ID: <62277310-02ee-aeb6-fe6e-691e39fdca83@ed-elettronica.it> Hi, I have a problem with the installation of gdk on my Windows (64 bit); I've installed Python 2.7? and pygtk-all-in-one-2.22.5. If I edit a script with just the instruction "import gtk" and then I run it, I have this error: ? File "C:\CRISTINA\Python\import_gtk.py", line 1, in ??? import gtk ? File "C:\CRISTINA\Python\gtk.py", line 3, in ??? window = gtk.Window() AttributeError: 'module' object has no attribute 'Window' Instead, if I write "import pygtk", everything is ok. Can someone help me please? -- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Firma email ED.jpg Type: image/jpeg Size: 49123 bytes Desc: not available URL: