开发者

Run a python script and a compiled c code without terminal or dock item in Mac OS X

开发者 https://www.devze.com 2023-01-18 09:59 出处:网络
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 co

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 开发者_如何学JAVAit makes a dock item to appear).

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.

Thank you, Joon


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"

(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.)


have you tried using the nohup? lets say you have a launch script to start your program:

launch.sh:

nohup your_program & exit

0

精彩评论

暂无评论...
验证码 换一张
取 消