問題描述
我有一個簡短的問題,希望有人能幫助我.
I've got a quick question that I hope someone can help me with.
我正在創建/規劃一個需要跨平臺運行并使用 Windows com 庫的應用程序.過去,我使用 win32py 在 python 應用程序中運行這些 com 對象,我一直在做大量研究以在 Mac 上找到解決方案,但我沒有運氣.理想情況下,我想留在 Python 中,因為我已經有了使用這個庫的 Python 2.7 的工作代碼.但是,如果有其他語言的解決方案,我想聽聽.
I'm in the process of creating/planning an app that needs to run cross platform and use a com library from Windows. In the past I've used win32py to run these com objects in a python app, I've been doing a bunch of research finding a solution on Mac but I've had no luck. Ideally I'd like to stay in Python as I already have working code for Python 2.7 working with this library. If there is a solution in another language however, I would like to hear it.
我意識到這聽起來有點倒退,但長話短說,我必須讓這個 com 庫在 Mac 上運行.我將使用 iOS SDK 模擬器對一些 iOS 內容進行自動化測試.
I realize that this sounds almost sort of backwards, but to make a long story short I have to make this com library work on Mac. I'm going to be doing some automated testing of some iOS stuff with the iOS SDK simulator.
推薦答案
COM 僅適用于 Windows.COM 需要大量使用 Windows 注冊表和 WinAPI.我已經看到一些框架在其他操作系統上模擬或模擬 COM 行為(例如 Linux/Solaris 上的 MainWin),但我不知道有哪一種適用于 Mac.
COM is Windows only. COM requires extensive use of the Windows registry and WinAPI. I've seen some frameworks emulate or mock COM behavior on other operating systems (e.g. MainWin on Linux/Solaris), but I don't know of one for Mac.
win32py 模塊只是 WinAPI 調用的包裝器.因此,如果 WinAPI 不可用,win32py 將無法工作.
The win32py module is just a wrapper around WinAPI calls. So if the WinAPI isn't available, win32py won't work.
您需要的邏輯是否可以包裝服務?換句話說,您可以在 Windows 機器上托管服務并讓 Mac 應用程序調用該服務嗎?
Is the logic you need something you can wrap a service around? In other words, can you host a service on a Windows box and have the Mac application invoke the service?
這篇關于Mac 上的 Pywin32(com 對象)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!