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

后端 未结 2 1291
野趣味
野趣味 2020-12-06 02:28

I\'d like to write cross platform Python scripts that are GUI frontends for command line programs. The problem is I know a few Mac users who think that using the terminal w

2条回答
  •  旧巷少年郎
    2020-12-06 02:44

    You might want to look at Platypus. It's a freeware app for generating apps which wrap scripts.

    Another way to do something like that is using Automator or even AppleScript Editor. Either can produce an application which just runs a script.

    Update:

    For Automator: Launch Automator, select the Application template, type "script" in the search field, double-click Run Shell Script, switch the shell pop-up menu to /usr/bin/python, type/paste your Python script into the text field. Or, leave the pop-menu on /bin/bash and just write an invocation of an external script in the text field. Save as an application.

    You can also view help from its Help menu.

    For AppleScript, launch AppleScript Editor, type the following as the script:

    do shell script "/usr/bin/true"
    

    Replace /usr/bin/true with the path to whatever script you like. Save as an application.

    Again, there's help in the Help menu.

提交回复
热议问题