El Capitan上具有Mac子进程的Mac App [英] Mac App on El Capitan with Python Child Process

查看:126
本文介绍了El Capitan上具有Mac子进程的Mac App的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在构建Mac应用程序,其体系结构的一部分是它剥离了python子进程以在后台对某些文件建立索引(有一些更简单的库可用于为python编制索引).它通过直接执行python文件来启动python.然后,父Mac应用程序和子python进程通过套接字相互通信.

I have been building an Mac app and part of its architecture is that it spins off a python child process to index some files in the background (there are simpler libraries to use for indexing for python). It launches the python by executing the python file directly. The parent Mac app and child python process then communicate with each other through sockets.

将MacBook升级到El Capitan之后,我遇到了此处描述的防火墙问题:

After upgrading my MacBook to El Capitan, I've been hit with the firewall issue described here: How to allow Python.app to firewall on Mac OS X?.

当我打包应用程序并将其首次在El Capitan上本地部署时,出现相同的您是否希望应用程序'Python.app'接受传入的网络连接"对话框.我按照该帖子中的步骤为自己解决了此问题.但是,我最终的目标是将我的应用程序分发给其他用户,在那种情况下,我不希望他们像禁用该应用程序的建议那样禁用系统完整性保护.

When I packaged my application and deployed it locally for the first time on El Capitan, I got the same "Do you want the application 'Python.app' to accept incoming network connections" dialog. I followed the steps in that post to resolve the issue for myself. However, my eventual goal is to distribute my app to other users, in that case I wouldn't want them to go through disabling the System Integrity Protection like the post suggested to make my app work.

我知道我可以尝试将索引功能集成到Mac应用程序本身中,但是该问题还有哪些其他可能的解决方案?我该如何允许python进程通过套接字进行通信,而无需用户或我本人进行复杂的代码签名过程?

I know I could try to integrate the indexing functionality into the Mac app itself, but what are some other possible solutions to this problem? How would I allow the python process to communicate via sockets without the users, or myself, needing to go through a complicated code signing process?

推荐答案

也许不使用套接字,而是可以通过从stdin读取和/或写入stdout来使Python进程与父进程通信?这样可以避免与防火墙的任何交互.

Perhaps instead of using sockets, you could have your Python process communicate with the parent process by reading from stdin and/or writing to stdout? That would avoid any interactions with the firewall.

这篇关于El Capitan上具有Mac子进程的Mac App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆