Questions tagged [pythoncom]

PythonCOM is a module, encapsulating the OLE automation API.

PythonCOM is a module, encapsulating the OLE automation API.

http://timgolden.me.uk/pywin32-docs/html/com/win32com/HTML/PythonCOM.html

108 questions
0
votes
0 answers

Creating a registration free python COM component

I've been trying to understand COM libraries but I'm still confused. If I want to make a python object com visible, the only instructions I can find are to make a python script that sets up a COM server which is invoked and used to generate class…
Greedo
  • 4,967
  • 2
  • 30
  • 78
0
votes
1 answer

'NoneType' object has no attribute 'SaveAs' docx2pdf on windows

from docx2pdf import convert import pythoncom #flask rest api @app.route('/api_v1/get_pdf/',methods=['GET']) def get_pdf(): if threading.currentThread ().getName () != 'MainThread': pythoncom.CoInitialize () …
Mehrdad Dadvand
  • 340
  • 4
  • 19
0
votes
1 answer

From python numpy array or list to COM SAFEARRAY

Is there any built in method or any other way to translate a python numpy array/list to COM SAFEARRAY? There is a similar method in R: R Matrix to COMSAFEARRAY Quite weirdly I have not found anything in python. I want to use it in order to pass an…
0
votes
0 answers

How can pythoncom.PumpMessages() restart after PostQuitMessage?

I use a hook to check for Mouse Event and Keyboard Event, and I create a new thread for the hook because I have some other work to do. The hook thread consumes CPU all the time, so I want to pause it occasionally (for efficiency). I tried using…
Freddy
  • 13
  • 4
0
votes
0 answers

"CoInitialize has not been called" error when running code for a second time using Python Flask Win64 (error arises from pyttsx3)

I have a strange error in my Python Flask app running on VS Code in Windows 10. The app runs as intended for the first time, however whenever I run the app for a second time, I get this error: "CoInitialize has not been called". I've tried using…
Leon
  • 1
  • 1
0
votes
1 answer

pythoncom module not found (pywin32 is installed) - with a Python2.7 virtual environment

I need to set up a Windows 64-bit PC Virtual Environment with Python 2.7 to run a script that I didn't write, and I'm not entirely sure the usage it has, but it imports pythoncom (a .NET communication module as far as I could understand). It seems…
0
votes
0 answers

My python code runs once, but I get an error when I run it twice

I have a little python script that checks my current IPv4 DNS Server address. It's working just fine. I use the wmi package. Now: I use this script in Kodi. And first time it runs, it runs perfectly. But the second time I get a weird error. Why…
NoIdeaJoe
  • 19
  • 5
0
votes
1 answer

Python script monitors click events but blocks them, not allowing the click event to pass through

I've written a simple program which allows you to record click events and save them. You can then load the save again, and it will fire all the click events again as you saved them. For the folks wondering, I wrote this program a year ago for…
Irash
  • 65
  • 8
0
votes
1 answer

how do I open read-only excel from python using win32com

I need to open an xls file from python using win32com as read-only and I seem not be getting the effect I desire Here is what I do: import win32com xl = win32com.client.Dispatch('Excel.Application') wb = xl.Workbooks.Open(file_path, ReadOnly=1) # 1…
JavaFan
  • 1,295
  • 3
  • 19
  • 28
0
votes
0 answers

AttributeError: module 'pythoncom' has no attribute 'Coinitialize'

My IDE is Pycharm. In order to use win32com.client in a new thread. I used pythoncom.CoInitialize() as many guys suggested here before calling win32com.client.DispatchEx(). But I got the following error. AttributeError: module 'pythoncom' has no…
0
votes
1 answer

How to close Windows Portable Device IStream opened in Python / pythoncom / comtypes

I'm using Windows Portable Device in python with pythoncom and comtypes. I'm in trouble because when I request for WPD_RESOURCE_THUMBNAIL resource, some android devices returns a "square" thumbnail while the raw image has 16:9 format (or…
shakraw
  • 39
  • 7
0
votes
1 answer

How do I use ItemAdd Event to monitor a shared inbox in Python?

I am wanting to make a outlook monitor in Python and have been researching on the topic. I am using Python 3.6 to try and monitor email received in a shared inbox on my outlook. I have the following code which will run: import…
0
votes
1 answer

How to break PumpWaitingMessages for every one hour and check for any unread mails

I want to break PumpWaitingMessages for every one hour and check for any unread mails and I tried with following code. However, if I increase time.time()-starttime>10 then my outlook is hanging and not able to progress, Sometimes I am even able to…
sireesha
  • 135
  • 1
  • 2
  • 11
0
votes
1 answer

How to import pythoncom module?. I installed py32win.exe

How to import pythoncom module?. I installed py32win.exe import pythoncom, pyHook, win32api, win32con ImportError: No module named pythoncom
Радик
  • 11
  • 1
  • 2
0
votes
0 answers

Python stops registering mouse inputs?

I have this code here. I coded this "bot" in order to increase mouse clicks. I've only one issue, python stops registering mouse inputs during that time.sleep (marked with #issue). When I set it to 20/30 ms I can barely notice it, but whenver I try…
Beter
  • 314
  • 4
  • 20