简体   繁体   中英

Python Pyro running on Linux to open a COM object on a remote windows machine, is it possible?

I have a project that requires the usage of COM objects running on a windows machine. The machine running the Python Django project is on a Linux box. I want to use Pyro and the django App to call COM objects on the remote windows machine. Is it possible? Any suggestion is appreciated?

Yes this is a perfect use case for Pyro, to create a platform independent wrapper around your COM access code.

At least I assume you have some existing Python code (using ctypes or pywin32 ?) that is able to invoke the COM object locally? You wrap that in a Pyro interface class and expose that to your linux box.

I think the only gotcha is that you have to make sure you pythoncom.CoInitialize() things properly in your Pyro server class to be able to deal with the multithreading in the server, or use the non-threaded multiplex server.

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