[Tutor] Running a script in the background (this time Cc'd to the list)

William R. Wing (Bill Wing) wrw at mac.com
Mon Sep 3 03:04:41 CEST 2012

On Sep 2, 2012, at 6:15 PM, Alan Gauld <alan.gauld at btinternet.com> wrote:

> On 02/09/12 21:30, William R. Wing (Bill Wing) wrote:
>> My suggestion would be to take the script and run it through py2app,
>> which will turn it into a stand-alone application which can then
>> be added to your list of StartUp or LogIn applications.
> Why not just create a one line shell script that starts the python program and add that to the Startup? What value does using py2app add in this case?
> -- 
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/

Apple's mechanism for launching applications at login is picky about what it will accept as a legitimate application to add to the list.  You could get there by creating an "AppleScript" that did the same thing.  AppleScripts can be saved as applications and an AppleScript can call a python script (I've actually done that, but it leaves you maintaining two bits of code, not just one).  To the best of my knowledge, there is no way you can convince the application-picker to accept a shell script (or a raw python script) as an application.  You can add it to the list, but at login, what happens is that the editor you used to create the script gets invoked with the script opened in it.


More information about the Tutor mailing list