How do I communicate between python and a mac application?

后端 未结 5 1783
慢半拍i
慢半拍i 2021-01-20 20:34

This might be a vague question, but I failed to rephrase it properly. So here\'s an explanation.

I developed an app that was originally developed as a Mac applicatio

5条回答
  •  猫巷女王i
    2021-01-20 21:17

    In my eyes the simplest way to establish communication between two applications is the client-server protocol XMLRPC. Both Cocoa and Python do support it.

    The Python part is fairly simple:

    import xmlrpc.client
    rpcProxy = xmlrpc.client.ServerProxy(URL_OF_SERVER)
    rpcProxy.SendKeyToApp(pid,key)
    

    As for the Cocoa-part, I don't know, but it seems to be possible: XML-RPC Server in Cocoa or Best way to use XML-RPC in Cocoa application?

提交回复
热议问题