Easy way to run Python scripts with the mouse in OS-X

I would like to write cross-platform Python scripts that are GUIs for command line programs. The problem is that I know several Mac users who believe that using a terminal will have the same effect as dropping a computer from the top of a skyscraper. On Linux and Windows, it’s easy enough to set up a Python script so that the user can double-click the icon and the script starts without opening any additional windows. Is there an easy way to do this with OS-X? Will the user install another Python than the one that comes with OS-X? I could not find a definitive answer.

+5
source share
2 answers

You might want to watch Platypus . This is a free application for creating applications that transfer scripts.

Another way to do something like this is to use Automator or even the AppleScript Editor. Or you can create an application that just runs the script.

Update:

For Automator: Launch Automator select the application template, enter "script" in the search field, double-click Run Shell Script, switch the shell popup menu to /usr/bin/python, enter / paste your Python script in the text box. Or leave the popup menu on /bin/bashand just write an external script call into the text box. Save as application.

You can also view help in the help menu.

For AppleScript, start the AppleScript editor, enter the following as a script:

do shell script "/usr/bin/true"

/usr/bin/true script, . .

, "" .

+8

py2app . Python script, (wx, Tkinter ..), py2app - , OS X. Python, Python, ( ).

, , 50 , ( ).

+3

All Articles