Re: [python-win32] Dispatch vs EnsureDispatch performance

2024-07-17 Thread Sven Bardos via python-win32
Hi Mark, I found some time to debug and profile my issue a little bit more. In my scenario I call a COM method which returns a list of 14195 integers plus the amount of the found objects. If I profile that call I get the following: ncalls tottime percall cumtime percall

Re: [python-win32] Using win32com for ToastNotificationManager

2024-07-07 Thread Mark Hammond
If it is possible it would not be at all straight-forward :( It doesn't look like these objects expose IDispatch, which is what we would need. winrt probably is your best bet. Cheers On 2024-07-05 2:24 p.m., Patrik Dufresne wrote: Hello, Is it possible to use win32com/pythoncom to

[python-win32] Using win32com for ToastNotificationManager

2024-07-06 Thread Patrik Dufresne
Hello, Is it possible to use win32com/pythoncom to instantiate a ToastNotificationManager. Looking at the registry is seams all the interface is registered using a GUID, but I'm not familiar enough to know exactly how to create an instance of the ToastNotificationManager using python. I've

[python-win32] Open Excel in Background using Task Scheduler

2024-06-28 Thread Viliam Popovec
Hello, I have a Windows VM running in Azure cloud, which is connected to File Shares. I have created a Python script which downloads the excel files from the file shares, executes macros and copies the files back. I am able to get this working with a "foreground" task, i.e. launching the script

[python-win32] servicemanager could not be loaded

2024-06-02 Thread Lee Duncan
Hello Python-win32 mailing list: I just figured out my problem and wanted to share for anyone else. On a normal install of Python 3.12 using pip to install pywin32 I was getting "servicemanager.__file__ could not be loaded " pretty much no matter what I did. The message in event viewer was

[python-win32] Troubleshooting COM error after upgrade to .NET 6

2024-05-14 Thread Martin Wiboe
Hello I'm working with an application developed in .NET Framework, but recently migrated to .NET 6. The application provides a number of COM components, and I am unable to call them from python after the migration. Our other COM clients (Excel and FORTRAN) work as before. My code is as follows:

Re: [python-win32] Creating distributable packages/installers from python code for the windows platform

2024-04-26 Thread Jacob Kruger
Could very well be, but, for example, did now manage to get an installer sorted out using null soft NSIS scripting, and, it works fine, so, there's still something going wrong during inno setup's process, since am using the exact same .exe I compiled using pyInstaller. Will try experimenting

Re: [python-win32] pythonservice.exe registration failed used by another process

2024-04-26 Thread Mark Hammond
On 2024-04-25 9:29 p.m., Jacob Nolan via python-win32 wrote: Hi all, I've been having a reoccurring error across multiple windows installs and python versions (3.9.*-3.11.*) when performing an install of a python windows service. This is the result of calling *python service_config.py

Re: [python-win32] Creating distributable packages/installers from python code for the windows platform

2024-04-26 Thread Nikolay Spahiev
On 26.04.24 г. 10:53 ч., Jacob Kruger wrote: Hi there ... But, I thought that, just maybe, if I used something like inno setup to create an installer, it might help work around that initial distribution issue, but, the odd thing is inno setups compression/packaging seems to corrupt my

[python-win32] Creating distributable packages/installers from python code for the windows platform

2024-04-26 Thread Jacob Kruger
Hi there I am quite comfortable with having used things like pyInstaller, cx_freeze and, most recently, playing around with nuitka, in tems of compiling code into a form of executable for the iwindows platform, but, there seems to be another side issue - let me explain a bit more.

[python-win32] pythonservice.exe registration failed used by another process

2024-04-25 Thread Jacob Nolan via python-win32
Hi all, I've been having a reoccurring error across multiple windows installs and python versions (3.9.*-3.11.*) when performing an install of a python windows service. This is the result of calling *python service_config.py install *on 3.9.5 The error is: |*copying host exe

Re: [python-win32] Dispatch vs EnsureDispatch performance

2024-04-17 Thread Mark Hammond
I'm mildly surprised by that - a profiler might show some low-hanging fruit, and/or might show different characteristics when many more functions are used. However, the primary reason for EnsureDispatch is for better support of the object model - there's far more context available and this

[python-win32] Tengo un problema con pyinstaller

2024-04-17 Thread Jeshua Garza
El problema esque tengo que esque cuando le doy a la versión de pyinstaller me aparece (no module named pyinstaller) y literalmente tengo todos instalado correctamente nosé que hacer porfa necesito una solución  ___ python-win32 mailing list

[python-win32] Fwd: Tengo un problema con pyinstaller

2024-04-17 Thread Jeshua Garza
El problema esque tengo que esque cuando le doy a la versión de pyinstaller me aparece (no module named pyinstaller) y literalmente tengo todos instalado correctamente nosé que hacer porfa necesito una solución  mi sistema operativo es Windows 11 y la versión de Python es la más reciente 3.12.3

[python-win32] Dispatch vs EnsureDispatch performance

2024-04-17 Thread Sven Bardos via python-win32
Hi, shouldn't be EnsureDispatch be faster than Dispatch once the code generation is done? I've measured it by calling 6000 COM calls like this: dirpath = Path('C:/Users/sbardos/AppData/Local/Temp/gen_py/3.10/') if dirpath.exists() and dirpath.is_dir(): shutil.rmtree(dirpath) app =

[python-win32] Open VI reference error

2024-04-16 Thread Riley Caminiti
Hi, I'd like to read a string output by a Labview executable using Python. As a test, I built my own Labview exe, and can successfully read the string output in Python using the following script: import win32com.client LabVIEW = win32com.client.Dispatch("Application.Application") VI =

Re: [python-win32] Help in deciphering error

2024-04-15 Thread Alok Bhargava
It absolutely does Mark - thanks so much! Based on the error details, I am fairly certain I am seeing the same issue (even though I use pyinstaller). So I will either use 3.11 or think of a solution that does not use Windows Service. Thank you for being so responsive - greatly appreciate your

Re: [python-win32] Help in deciphering error

2024-04-15 Thread Mark Hammond
The first comment of https://github.com/mhammond/pywin32/issues/2155 has STR that doesn't involve pyinstaller or custom executables. If you can reproduce that, then you are probably facing the same problem, so the solution is probably to use Python 3.11 until more information about the 3.12

[python-win32] Error running Python 3.12 app as a Windows Service (app created using pyinstaller 6.6.0)

2024-04-15 Thread Alok Bhargava
Hi all, I am running into an issue that I am unable to track down a resolution for. I have developed a Python Flask application for which I created a single-file executable using pyinstaller that I wish to run as a Windows Service. I researched on the internet to find the common Python

[python-win32] Help in deciphering error

2024-04-15 Thread Alok Bhargava
Hello, I would appreciate any help in diagnosing why this error occurs. I have WinPython installed on my Windows 11 Pro machine and not registered (registering did not change the outcome). I installed pyinstaller and generated a single file .exe. This is what I have encountered as documented

[python-win32] Which paths must be known by pythonnet to import the win32api module?

2024-04-05 Thread Tebjan Halm
Hello pywin32 mailing list. I am currently trying to run a simple script showing a message box using pythonnet. That is running python from the .NET runtime. I've started a discussion here: https://github.com/pythonnet/pythonnet/discussions/2356 Maybe someone can chime in to help me configure

[python-win32] PyInstaller giving me hassles the last week or so, operating under windows 11 64-bit - package required

2024-04-01 Thread Jacob Kruger
This started happening this past week, and, while it's worked fine in the past, the moment I try to launch the pyinstaller process at all, to generate compiled output, or even if just launch it with no command line options, I receive the following error message:

Re: [python-win32] __getattr__ Error

2024-03-18 Thread haraldarminmassa
My usage is: I have to bundle all the pys in one exe file. And do not want that exe-file to write into it's directory. So I do: makepy -o OLE_Excel16.py and within my program: import OLE_Excel16 as Excel olx = Excel.Application() On Mon, Mar 18, 2024 at 3:25 PM Alok Bhargava wrote: >

Re: [python-win32] __getattr__ Error

2024-03-18 Thread Alok Bhargava
Many thanks Mark - it is great to be able to learn more about the system from its creators! On Mon, Mar 18, 2024 at 10:25 AM Alok Bhargava wrote: > Many thanks Harald! > > If I specify the file location when running makepy, how do I ensure > myapplication knows where to find them? Again this

Re: [python-win32] __getattr__ Error

2024-03-18 Thread Mark Hammond
In general, if you `from win32com.client.gencache import EnsureDispatch`, you should be able to use `EnsureDispatch` anywhere you previously used plain `Dispatch`, and that code should be automatically generated and used for you. You generally only need to specify a special location or run

Re: [python-win32] __getattr__ Error

2024-03-18 Thread Alok Bhargava
Many thanks Harald! If I specify the file location when running makepy, how do I ensure myapplication knows where to find them? Again this may be a silly question, so please bear with me. Thank you! On Mon, Mar 18, 2024 at 9:36 AM wrote: > Hi Alok, > > there should be a __gencache__

Re: [python-win32] About support for Windows XP and Internet Explorer, and possible leftover code

2024-03-18 Thread Mark Hammond
On 2024-03-18 1:57 a.m., Samuel Therrien wrote: I've been wondering, what's the state, intent, or policy on support for older OSes? I haven't seen it be mentioned (for example on the readme), yet still see a handle of areas of code referencing support for older OSes (XP, Vista, 7, 8.1, CE,

Re: [python-win32] __getattr__ Error

2024-03-18 Thread Mark Hammond
On 2024-03-18 9:12 a.m., Alok Bhargava wrote: Hi and thank you for your insightful guidance on Jannis' question.  I am running into similar issues as I work with a 3rd party COM app. This may be a silly question but could you point me to where the generated class files are located? I think

Re: [python-win32] __getattr__ Error

2024-03-18 Thread haraldarminmassa
Hi Alok, there should be a __gencache__ directory somewhere, which contains the generated files. But it is WAY easier to just use the -o-- Create output in a specified output file. If the path leading to the file does not exist, any missing directories will be

Re: [python-win32] __getattr__ Error

2024-03-18 Thread Alok Bhargava
Hi and thank you for your insightful guidance on Jannis' question. I am running into similar issues as I work with a 3rd party COM app. This may be a silly question but could you point me to where the generated class files are located? Many thanks! On Mon, Mar 18, 2024 at 7:43 AM wrote: >

[python-win32] About support for Windows XP and Internet Explorer, and possible leftover code

2024-03-18 Thread Samuel Therrien
I've been wondering, what's the state, intent, or policy on support for older OSes? I haven't seen it be mentioned (for example on the readme), yet still see a handle of areas of code referencing support for older OSes (XP, Vista, 7, 8.1, CE, ...), but also commits and PRs dropping support for

Re: [python-win32] __getattr__ Error

2024-03-18 Thread haraldarminmassa
Hi Jannis, a good way forward: create less-dynamic COM-bindings by using makepy.py (it is part of your win32com-client installation, but linked here for the dokumentation) https://github.com/SublimeText/Pywin32/blob/master/lib/x32/win32com/client/makepy.py With makepy py you can create a (very

[python-win32] __getattr__ Error

2024-03-17 Thread Jannis via python-win32
Hello together, I am trying to automate a point cloud creation out of CATParts in CATIA. The win32com client can access CATIA documents, but NOT methods and attributes in the parts. I get the following error: File

Re: [python-win32] Creating COM objects in a new process

2024-02-27 Thread Aviv Bergman
Thanks Wuping As I also implement the COM server, this really helped finding the solution - I had to re-implement win32com.server.localserver.serve and pass flags=pythoncom.REGCLS_SINGLEUSE | pythoncom.REGCLS_SUSPENDED ___ python-win32 mailing

Re: [python-win32] Creating COM objects in a new process

2024-02-26 Thread Wuping Xin
This is related the COM instance model implemented on the COM server side, not on the client side. Specifically, in the start-up code of the COM server application, there should be a call to CoRegisterClassObject(CLSID, pUnk, dwClsContext, flags, ). The key point is the fourth parameter

Re: [python-win32] Creating COM objects in a new process

2024-02-26 Thread Mark Hammond
I'm not aware of anything, other than arranging for the existing process to terminate. Cheers, Mark On 2024-02-26 4:12 a.m., Aviv Bergman wrote: Hi I'm trying to create several COM objects, each in a new process, but it seems DispatchEx is reusing the existing COM server process, is

[python-win32] Creating COM objects in a new process

2024-02-26 Thread Aviv Bergman
Hi I'm trying to create several COM objects, each in a new process, but it seems DispatchEx is reusing the existing COM server process, is there any way to force creating new objects in a new process? I'm using a python COM server,  minimal example attached Thanks Aviv - import

[python-win32] OLE Error during dispatch

2024-02-13 Thread Alexander Urbina
Hi All, So I'm currently having an issue with pywin32, I keep getting this OLE error: Error: (-2146233036, 'OLE error 0x80131534', None, None), is there anyone who is familiar with how to solve this issue or knows what the root cause is? I'm trying to connect to an application called INCA from

Re: [python-win32] pywin32 incompatible with Python 3.12

2024-02-07 Thread Mark Hammond
pywin32 is overdue a release, compounded by the fact I no longer have a Windows machine available. As noted in the readme, github actions to create "artifacts" on some pushes, so, eg, https://github.com/mhammond/pywin32/actions/runs/7713784334/artifacts/1206054711 will have a recent wheel for

[python-win32] pywin32 incompatible with Python 3.12

2024-02-07 Thread Wuping Xin
Python 3.12 removed the module 'imp', but pyscript.py still relies on 'import imp' - this will lead to: ModuleNotFoundError: No module named 'imp' pyscript.py", line 213, in InitNew import imp ModuleNotFoundError: No module named 'imp' Solutions? Wuping

Re: [python-win32] PyWin32 Advanced Options

2024-01-19 Thread Steven Manross
Your mileage may vary, but while using setprinter.exe for a similar task (many years ago) I found that the different trays can sometimes be large values like 260… Your best bet might be to set the tray manually in the UI, and then try to look at those values via something like setprinter.exe

[python-win32] PyWin32 Advanced Options

2024-01-18 Thread Michael Litvin
Hello, I am trying to print from python using the bypass tray on my printer, but I cannot seem to get it working and it always prints from tray 1. Here is my code: image = Image.open(file_path) printer_handle = win32print.OpenPrinter(printer_name) p_info =

Re: [python-win32] PythonService was unable to locate the service manager

2024-01-18 Thread Jacob Nolan via python-win32
E: is just a local harddrive. The full python install and files under the E: drive is accessible for both the local SYSTEM user, my user and administrator. It is configured to run as the Local System Account. I am successfully able to install the service initially via admin command prompt,

Re: [python-win32] Relevance of very outdated `Pythonwin/pywin/idle`

2024-01-12 Thread Mark Hammond
Some of those modules are actually used by pythonwin, particularly by pywin/scintilla - so while I agree the ability to update them is questionable, I don't think just killing the directory makes sense. Did you try to remove it? I'd be surprised if Pythonwin continues to work in that scenario.

[python-win32] Relevance of very outdated `Pythonwin/pywin/idle`

2024-01-12 Thread Samuel Therrien
Hi! I recently had to do a deep dive into https://github.com/mhammond/pywin32/tree/main/Pythonwin/pywin/idle as part of a previous PR. See comment: https://github.com/mhammond/pywin32/pull/2102#discussion_r1380422005 Of course it is extremely outdated, but I think the interesting part is that

Re: [python-win32] PythonService was unable to locate the service manager

2024-01-12 Thread Mark Hammond
On 2024-01-11 5:46 p.m., Jacob Nolan via python-win32 wrote: I performed a custom install for all users on my E: drive (E:/installs/python3). Added it to the path. It is not under my specific user account. My understanding is this is a global install. What exactly is E:? If anything other

Re: [python-win32] PythonService was unable to locate the service manager

2024-01-12 Thread Jacob Nolan via python-win32
I performed a custom install for all users on my E: drive (E:/installs/python3). Added it to the path. It is not under my specific user account. My understanding is this is a global install. I then run it under administrator privileged cmd and successfully install the service. Looking at

Re: [python-win32] PythonService was unable to locate the service manager

2024-01-11 Thread Mark Hammond
The "" part sounds like it is failing to find Python itself. Where is Python installed? Is it possible the user running the service can't access that location? I believe Python being installed in the default location could cause this if the server is running as any other other than the user

[python-win32] PythonService was unable to locate the service manager

2024-01-11 Thread Jacob Nolan via python-win32
Currently experiencing this issue on my Windows machine when installing a Windows Service. This is the error output I get from running in the cmd as administrator. Restricting me from being able to run my services. *- PythonService was unable to locate the service manager. Please see the

Re: [python-win32] Seeking help to understand building of Microsoft Appstore Python

2023-11-02 Thread Piyush Dubey
Greetings, I am trying to load Python dynamic libraries to interface Microsoft Appstore Python from an application that I am trying to develop. Now when I use the “LoadLibraryExW” (which is a WIN32 API:

[python-win32] Seeking help to understand building of Microsoft Appstore Python

2023-10-31 Thread Piyush Dubey
Greetings community, I am trying to load Python dynamic libraries to interface Python from an application that I am trying to develop. The Python version I am trying to load is the one available in the Microsoft AppStore. Now when I use the “ LoadLibraryExW” (which is a WIN32 API:

[python-win32] VB6 Listbox methods fail through ROT

2023-10-04 Thread dzzie via python-win32
Wondering if anyone might have an insight on this. If we add a vb6 listbox to the ROT, and try to access it using GetObjectwe can not access any of its methods with an error "Member not found" import win32com.client form1 = win32com.client.GetObject('PyComTest.Form1') form1.caption = "hi from

Re: [python-win32] Uninstallation Command Required

2023-09-20 Thread Steven Manross
As well, you can look in the windows registry in the Uninstall key (but need to find the specific key for your python installer) # this registry key is for version 3.9.12 (but the only thing that would change on other versions would be the final key name: the GUID)

Re: [python-win32] Uninstallation Command Required

2023-09-20 Thread Bob Kline
Depends on how it was installed. If you used the installer from python.org, it might look like this: python-3.11.1-amd64.exe /uninstall /quiet > uninstall.log (Adjust the name of the executable to match the version you installed.) If you used some other distribution (for example, from

[python-win32] Uninstallation Command Required

2023-09-20 Thread Sujith R
Hi Team, I need to uninstall python via windows command prompt. I tried lots of various commands but it’s not worked well. Can you please help me to solve this issue. SUMMARY: Need a proper uninstall command for windows Thanks in advance. ___

Re: [python-win32] AddObject from C

2023-09-19 Thread dzzie via python-win32
Seems to be solved: /lib/site-packages/pycom/__init__.py def GetObject(Pathname=None, Class=None, clsctx=None): ...if Class is not None:     return GetActiveObject(Class, clsctx)     else:     #first

[python-win32] AddObject from C

2023-09-19 Thread dzzie via python-win32
Hi guys I am working with an embedded interpreter, how can I share an existing COM object from the C api ?(without using the ROT) Background: The host process is VB6 with a C helper DLL. I have stripped down the pywin32 library to compile directly into my helper dll with just the COM access

Re: [python-win32] Recommended web server implementation to actively run multiple flask web apps on a windows machine

2023-09-08 Thread Waldemar Osuch
I have a small Flask app running on IIS with wfastcgi https://pypi.org/project/wfastcgi/ PyPI project seems to be dormant but the package works :-) Cheers, Waldemar On Fri, Sep 8, 2023 at 1:50 AM Jacob Kruger wrote: > Thanks. > > > More to do with that, at times, I want to run forms of apache,

Re: [python-win32] Recommended web server implementation to actively run multiple flask web apps on a windows machine

2023-09-08 Thread Jacob Kruger
Thanks. More to do with that, at times, I want to run forms of apache, for things like the adminer database management, single page .php file, while sort of running flask alongside, and, yes, generally then just run flask on a different port, but, for example, when put flask in production,

Re: [python-win32] Recommended web server implementation to actively run multiple flask web apps on a windows machine

2023-09-08 Thread Jacob Kruger
Vernon, this is really just for dev testing, and/or for testing a bit across machines, etc. - would also never consider running an actual production web server on windows - last time did that was a very long time ago, when classic ASP, and ASP.net, running against MSSQL server were my focus

Re: [python-win32] Recommended web server implementation to actively run multiple flask web apps on a windows machine

2023-09-07 Thread Vernon D. Cole
I highly recommend nginx. I also highly recommend NOT running a web server on Windows. On Wed, Sep 6, 2023 at 1:14 AM Jacob Kruger wrote: > Hi there > > > My primary development focus at the moment is web applications, using > the flask web-framework, and, while, in development, I can just

[python-win32] Recommended web server implementation to actively run multiple flask web apps on a windows machine

2023-09-06 Thread Jacob Kruger
Hi there My primary development focus at the moment is web applications, using the flask web-framework, and, while, in development, I can just run them on different ports, etc. on my dev machine - windows 11 home 64 bit - in the past I worked with laragon or WAMPP when working with PHP

Re: [python-win32] python-win32 Digest, Vol 242, Issue 2

2023-09-05 Thread Wuping Xin
Did you run your "wrapped exe" package on the same computer where the package was wrapped, or on a new computer? If it was running on a new computer, probably it won't work because pywin32 is dependent on certain system registry entries. PyInstaller does not seem to package the registry.

Re: [python-win32] Exe not working correctly

2023-09-05 Thread Mark Hammond
Is it possible that the datetime module isn't being packaged? Directly importing that module at the top-level of your script might be enough to fix it. HTH, Mark On 2023-09-05 1:46 p.m., Nasser Issa wrote: Hello There, Currently been working with PyWin32 to interact with the Event Log

[python-win32] Consuming COM events

2023-09-04 Thread Mohindar Rao
How to consume COM events from python modules generated using makepy? I instance of Test works but how to implement events? class ITest(DispatchBaseClass): 'Dispatch-Interface for the Test object' CLSID = IID('{F0691CAD-0C9D-4357-9373-CE6972E1F8A5}') coclass_clsid =

Re: [python-win32] How to search Windows file structure (with existing indexes)

2023-08-15 Thread Dolezal, Vojtech
Hello, thank you so much for your reply. I completely missed the fact installing pywin32 also installed adodbapi, that was a crucial information with which I managed to do what I needed. Best regards, Vojtěch Doležal Od: Vernon D. Cole Odesláno: středa 9.

Re: [python-win32] python-win32 Digest, Vol 241, Issue 2

2023-08-09 Thread Chr Pqe
Hello It is not at all clear what you are asking. You are halfway there if you start with the right question as one famous man said... The link you provided isn't about "windows file structure" but about accessing databases. In any case, even if it could access perhaps Windows Search database,

Re: [python-win32] How to search Windows file structure (with existing indexes)

2023-08-09 Thread Vernon D. Cole
For reading file directories I recommend using pathlib from the Python standard library. On Wed, Aug 9, 2023 at 12:40 PM Vernon D. Cole wrote: > Because pywin32 is required for adodbapi to operate, it was merged into > pywin32 several years ago. Installing a current version of pywin32 will >

Re: [python-win32] How to search Windows file structure (with existing indexes)

2023-08-09 Thread Vernon D. Cole
Because pywin32 is required for adodbapi to operate, it was merged into pywin32 several years ago. Installing a current version of pywin32 will install adodbapi as part of it. It will appear as a separate module in the Python site-packages library tree. I have never tried accessing the Windows

[python-win32] How to search Windows file structure (with existing indexes)

2023-08-08 Thread Dolezal, Vojtech
Good afternoon, is it possible to search Windows file structure with use of indexes where available? There seems to be package named adodbapi which supposedly allowed for this, but according to its SourceForge page (https://sourceforge.net/projects/adodbapi/) it is now part of pywin32.

[python-win32] How to search Windows file structure (with existing indexes)

2023-08-08 Thread Dolezal, Vojtech
Good afternoon, is it possible to search Windows file structure with use of indexes where available? There seems to be package named adodbapi which supposedly allowed for this, but according to its SourceForge page (https://sourceforge.net/projects/adodbapi/) it is now part of pywin32.

[python-win32] Outlook issue with win32

2023-08-01 Thread Amanullah Amanullah
Hi, I am trying to automate outlook actions through win32com.client module from python. Intermittently I'm facing below error: -2147352567, 'Exception occurred.', (4096, 'Microsoft Outlook', 'Your server administrator has limited the number of items you can open simultaneously. Try closing

[python-win32] Win32com error

2023-08-01 Thread Amanullah Amanullah
Hi, I'm using win32com module in python to perform actions such as draft email, change subject, move email items to other sub folders, and also read email details within date range etc. Intermittently I'm facing below error: -2147352567, 'Exception occurred.', (4096, 'Microsoft Outlook', 'Your

Re: [python-win32] Getting Started

2023-07-14 Thread niki
On 13.07.23 г. 21:06 ч., Jaiven McIntosh wrote: Good Afternoon Win32 team. My name is Jaiven McIntosh. I am working for Edmund Optics this summer for an internship. My job is to create a macro that will change a specification on Solidworks prints. As we know Solidworks is VBA based for its

[python-win32] Getting Started

2023-07-14 Thread Jaiven McIntosh
Good Afternoon Win32 team. My name is Jaiven McIntosh. I am working for Edmund Optics this summer for an internship. My job is to create a macro that will change a specification on Solidworks prints. As we know Solidworks is VBA based for its macros. I have made a macro but I want to wrap it

Re: [python-win32] Question win32com.client.Dispatch

2023-07-11 Thread Mateo Gomez Montoya
Very helpful, thank you! El mar, 11 jul 2023 a las 13:45, Steven Manross () escribió: > When building your “AutoCad.Application” object, it looks like 2007 is the > default object… > > > > In your computer’s registry directly under HKEY_CLASSES_ROOT you should be > able to find a Key (FOLDER

Re: [python-win32] Question win32com.client.Dispatch

2023-07-11 Thread Steven Manross
When building your “AutoCad.Application” object, it looks like 2007 is the default object… In your computer’s registry directly under HKEY_CLASSES_ROOT you should be able to find a Key (FOLDER icon) that matches that name… as well, IF AutoCAD has different versions installed , you should be

[python-win32] Question win32com.client.Dispatch

2023-07-11 Thread Mateo Gomez Montoya
Hello, I'm trying to use the command of win32com.client.Dispatch("AutoCAD.Application") and on the computer that I'm working with there are two versions of AutoCAD one from 2007 and another from 2021. I want to use a program that I created with the most recent version but when I run my code it

Re: [python-win32] Python Active Scripting Error - should I ignore it?

2023-06-29 Thread Mark Hammond
On 2023-06-29 2:29 p.m., Wuping Xin via python-win32 wrote: OK,  I think this is a bug of pywin32, Line 37 of \win32comext\axdebug\documents.py, class DebugDocumentText(     gateways.DebugDocumentInfo, gateways.DebugDocumentText, gateways.DebugDocument  gateway.DebugDocumentText already

Re: [python-win32] Python Active Scripting Error - should I ignore it?

2023-06-29 Thread Wuping Xin via python-win32
OK, I think this is a bug of pywin32, Line 37 of \win32comext\axdebug\documents.py, class DebugDocumentText( gateways.DebugDocumentInfo, gateways.DebugDocumentText, gateways.DebugDocument gateway.DebugDocumentText already inherits from gateway.DebugDocument. This would cause Python to

[python-win32] Python Active Scripting Error - should I ignore it?

2023-06-29 Thread Wuping Xin via python-win32
When I running a Python Active Script, DebugView captured the following errrors - any advice? [22076] File "C:\Users\.\AppData\Local\Programs\Python\Python39\lib\site-packages\win32comext\axscript\client\framework.py", line 729, in SetScriptSite [22076] from . import debug [22076]

Re: [python-win32] Question about pywin32 and Anaconda

2023-06-07 Thread Wuping Xin
You are right. Seems Anaconda adds “SKIP_ANACONDA” in their customized pywin32_postinstall.py, and the whole COM thing not working with Anaconda On Wed, Jun 7, 2023 at 11:38 AM Mark Hammond wrote: > pywin32_postinstall.py ( > https://github.com/mhammond/pywin32/blob/main/pywin32_postinstall.py)

Re: [python-win32] Question about pywin32 and Anaconda

2023-06-07 Thread Mark Hammond
pywin32_postinstall.py (https://github.com/mhammond/pywin32/blob/main/pywin32_postinstall.py) does not mention anaconda. The fact anaconda ships a version of pywin32 with it has caused problems though - maybe that's in a fork of theirs? If so, you need to ask them. Mark On 2023-06-07 9:18

[python-win32] Question about pywin32 and Anaconda

2023-06-07 Thread Wuping Xin
pywin32_postinstall.py, line 406, "SKIP_ANACONDA", why? Does that mean Anaconda is NOT whole-heartedly supported by pywin32? ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32

Re: [python-win32] How to enable pywin to evaluate -X utf8 flag

2023-06-06 Thread Gualtiero Scotti
Thank you Mark, I'm going to try... I haven't tried your demo yet. My code doesn't work with or without the command line change Best regards Il giorno mar 6 giu 2023 alle ore 16:38 Mark Hammond < mhamm...@skippinet.com.au> ha scritto: > That error typically means your Python code raised an

Re: [python-win32] How to enable pywin to evaluate -X utf8 flag

2023-06-06 Thread Mark Hammond
That error typically means your Python code raised an exception before the service could be started. You probably need some way to track that down - eg, some way to discover stdout/stderr from your service - win32traceutil etc might help depending on how the service is configured. Does the

Re: [python-win32] How to enable pywin to evaluate -X utf8 flag

2023-06-06 Thread Gualtiero Scotti
Thank you Mark for your response, and your explanation.You are right, python.exe is not involved but I thought you handled the flag in your embedded calls.. When I try to start service it doesn't start and the error message is: *Error starting service: The service did not respond to the start

Re: [python-win32] How to enable pywin to evaluate -X utf8 flag

2023-06-06 Thread Mark Hammond
pythonservice.exe doesn't "wrap" python.exe - it's a stand-alone executable which embeds Python. Thus there's no way to pass a cmd-line param to python.exe as python.exe isn't involved. You could patch pythonservice.exe to handle that arg, then do whatever it is python.exe does with that arg.

Re: [python-win32] How to enable pywin to evaluate -X utf8 flag

2023-06-06 Thread Gualtiero Scotti
HI Mark and Hi all, as I wrote previously Mark's solution did not work for me. I need pythonsevice.exe is able to pass -X utf8 parameter to python interpreter or in alternative is able to evaluate evaluate the environment variable PYTHONUTF8=1. Any suggestions? Please help me. Thanks in advance

[python-win32] stat fields seem wrong when accessing files over SMB on Windows

2023-06-01 Thread Jason Bowen
Hey Python on Windows folks, I just wanted to send this as a heads up about what seems to be a bug I've run into with newer pre-GA releases of Python 3.12 (cf. 3.12a7 and 3.12b1). I've filed an issue on the CPython repo: https://github.com/python/cpython/issues/105212 The gist is that up

Re: [python-win32] Setting Focus Assist Mode via COM

2023-06-01 Thread name zero via python-win32
Hey, thanks for your hints. I guess my easiest option would be to build a C++ CLI (.exe) from the code in the Gist and just call it with "subprocess.check_output()". Best regards On Thursday, June 1, 2023 at 07:09:02 PM GMT+2, Bill Tutt wrote: This IDL snippet from the GIST contains

Re: [python-win32] Setting Focus Assist Mode via COM

2023-06-01 Thread Bill Tutt
This IDL snippet from the GIST contains the GUID you're looking for: [uuid(f53321fa-34f8-4b7f-b9a3-361877cb94cf)] coclass QuietHoursSettings { [default] interface IQuietHoursSettings; } coclass's are the COM object. The interface guid you mentioned is that you need to supply to

Re: [python-win32] How to enable pywin to evaluate -X utf8 flag

2023-06-01 Thread Mark Hammond
https://github.com/mhammond/pywin32/blob/main/win32/Demos/service/nativePipeTestService.py is a demo of using a service using python.exe and supports specifying the command-line, so that might be an option? Mark On 2023-06-01 5:28 a.m., Gualtiero Scotti wrote: Hi, I need to start my python

[python-win32] How to enable pywin to evaluate -X utf8 flag

2023-06-01 Thread Gualtiero Scotti
Hi, I need to start my python application through windows service. For this purpose I use pywin32. I'm not able to make a Python instance to evaluate the -X uf8 flag. This flag must be passed during python invocation only and not when it is already started. After some investigations I've found

Re: [python-win32] unknow solution

2023-05-31 Thread Christoph J. Dorner
Hey guys, just one idea from a problem I had: Not succeeding to call ACCESS via pywin32 in the same way I succeeded to call EXCEL I learned that not all 32bit versions of Office applications provide a suitable 64bit proxy as part of their COM interface. I do not know which bitness your Office

Re: [python-win32] unknow solution

2023-05-31 Thread Martín Trujillo Raddatz
Thanks! Finally the problem is Word app, i try repair and reinstall, din not work. its seems that a virus may be affecting it, we are now moving the scripts to other machine ir orden to determine if the proble is Word or other thing. ** *Martín Trujillo

Re: [python-win32] Setting Focus Assist Mode via COM

2023-05-31 Thread Steven Manross
Interfaces are definitely different and cannot be used with IDispatch, etc. Someone with more experience might be able to direct you to something, but as far as I know, that’s reserved for C++ (or likely ctypes in python… but that’s on the fringe of what I’m capable of helping with – and

Re: [python-win32] Setting Focus Assist Mode via COM

2023-05-31 Thread name zero via python-win32
Hi, thanks for explaining the issue with clsids. The "application" is basically part of MS Windows. Talking to it via COM is 100% possible, as the C++ code (that is part of the GitHub-Gist) demonstrates. It just doesn't work with pywin32. When I look for "6bff4732-81ec-4ffb-ae67-b6c1bc29631f"

Re: [python-win32] Setting Focus Assist Mode via COM

2023-05-30 Thread Steven Manross
While I haven’t worked on exactly what you are working on: I’d first verify suggest that the application that installs this class needs to be installed on the PC you are trying to create the automation from, because “Class not Registered” isn’t a python error, and it talks more directly to the

Re: [python-win32] unknow solution

2023-05-30 Thread Steven Manross
While I’ve done word automation in the past, is it possible that there’s any issues with the word application installation itself? Or maybe you might have multiple scripts trying to open/write files simultaneously? As well, I might consider looking at task manager on your web server to see if

  1   2   3   4   5   6   7   8   9   10   >