What is the difference between win32com.client and pythoncom?

Asked 2 years ago, Updated 2 years ago, 15 views

I'm using "win32com" while doing Python I looked at the examples and found that pythoncom is also used together. What is pythoncom?

python

2022-09-22 20:33

1 Answers

Before that, we need to learn and understand a little about COM, OLE, and ACTIVEX.

Pythoncom is a module that collects the utility functions needed to use the win32com package.

I think CoInitialize, PumpWaitingMessages are the most commonly used functions

When using COM in a thread, it must be the pythoncom CoInitialize function, and PumpWaitingMessages is used to wait for messages.

The key point is that understanding COM is essential to properly use win32com.


2022-09-22 20:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.