简体   繁体   中英

Python and win32 API - using a C file

With ActiveState Python comes a win32api module. I need to implement something that monitors directories recursively for file-changes. Actually there's an example in the MSDN library using C. I don't know whether the win32api bindings are sufficient for something like this.

Can I import this into a Python project? Because it may be easier to write the file-alteration monitor itself in C, and to handle the results within Python. The problem is: how do I make that interact with each other.

Why not try some of the python win32 examples here. It uses pywin32 and does what you want.

The "C" code that you have mentioned with link to MSDN uses FindFirstChangeNotification . Tim Golden's example uses the same through python win32 bindings. I guess this is what you want.

All windows APIs are exposed and can be utilized via pywin32.

Read the documentation and try it out for yourself. win32file . FindFirstChangeNotification , etc. are there and work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM