在Mac OS X中运行没有终端或停靠项的python脚本和已编译的c代码 [英] Run a python script and a compiled c code without terminal or dock item in Mac OS X

查看:53
本文介绍了在Mac OS X中运行没有终端或停靠项的python脚本和已编译的c代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于stackoverflow的大力帮助,我的程序的Mac版本的开发已完成.现在,我需要部署程序,我想知道是否有任何方法可以隐藏"正在运行的Python代码(它也运行.so库,似乎使停靠项出现了.)

For great help from stackoverflow, the development for the Mac version of my program is done. Now I need to deploy my program, and I was wondering if there is any way to "hide" my running Python code (it also runs .so library and it seems it makes a dock item to appear).

该程序应该在后台运行,如果我可以隐藏任何终端机或停放项,那就太好了.在Windows或Linux中,这很容易,但是我仍然不习惯Mac,也无法弄清楚该怎么做.

The program is supposed to be running in the background and it would be great if I can hide any terminal or dock items. In Windows or linux, it was easy, but I am still not that used to Mac and could not figure out how to do this.

谢谢你,琼

推荐答案

您是否正在使用py2app并分发软件包?如果是这样,您可以在info.plist中设置LSBackgroundOnly.

Are you using py2app and distributing a package? If so, you can set LSBackgroundOnly in info.plist.

right-click on your package
choose *Show Package Contents*
double click on info.plist in Contents to open the property list editor
Add Child "Application is background only"

(这会使应用程序不可见.如果您的应用程序具有UI,而您只想隐藏停靠图标,请使用LSUIElement,它是属性列表编辑器中的应用程序是代理".)

(That makes the application invisible. If your application has a UI and you just want to hide the dock icon, use LSUIElement, which is "Application is agent" in the property list editor.)

这篇关于在Mac OS X中运行没有终端或停靠项的python脚本和已编译的c代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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