1

I've written a little GUI with tkinter for my own purposes on my Mac. I've written a two-line bash script to run it, and I can launch it from my desktop by double-clicking an icon. This is fine, but it pops up a terminal window, which I find annoying.

I would like to have it run as an app, without opening a terminal window. I followed the instructions in ccpizza's answer to create an app with Automator. I chose /usr/bin/python as the shell, and pasted in my python code. When I click on the desktop icon, I get an error box that says,

The action “Run Shell Script" encountered an error.  

The console log has the error,

LaunchServices: Could not store lsd-identifiers file at /private/var/db/lsd/com.apple.lsdschemes.plist

I saw that /private/var/db/lsd is owned by root and I am the owner of the app. I tried

sudo chown root <appname>

and it doesn't give an error, but I am still shown as the owner of the app.

I've also tried choosing usr/local/bin/bash as the shell script, pasting in my bash script. When I run click the icon, I don't even get an error box, but the same error shows up in the console log.

Is there an easy fix for this? I'm just interested in getting this method to work. I'd rather not do anything more elaborate, like installing py2app or platypus.

saulspatz
  • 5,011
  • 5
  • 36
  • 47
  • This isn't a Python question... it's a Mac OS specific question. The same kind of thing happens on windows and there are solutions that hide the window on windows. The solutions usually involve 3rd party tools – Mike from PSG Sep 19 '18 at 19:45

2 Answers2

1

I ended up getting platypus. It was trivial to do what I wanted. Just pick "None" for the interface.

saulspatz
  • 5,011
  • 5
  • 36
  • 47
0

If you just want to write a python script and run as a app, you can try pyinstaller.

Rouzip
  • 101
  • 3