[Tutor] Running a script in the background
William R. Wing (Bill Wing)
wrw at mac.com
Sun Sep 2 23:32:56 CEST 2012
On Sep 2, 2012, at 5:06 PM, Michael Lewis <mjolewis at gmail.com> wrote:
> Michael, I see you have several Windows answers, but it doesn't look as though you found quite what you were hoping for on OSX. 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. If you never request input or produce output, it will quite happily run in the background with no window and no menu (although by default there will be an icon in the dock). At that point it is so much a background application that the ONLY way you can quit it is via the Force Quit dialog. If you generate status or housekeeping print messages, they will show up in ~/Library/Logfiles. Py2app isn't particularly memory efficient, even a minimal application tends to run close to 9-10 Mbytes, but if it spends most of its time sleeping, it will use very little in the way of system resources.
> Good luck,
> Thanks, Bill. That is definitely more of what I am looking for and actually found that through some googling. What I am confused about now, is what's really the difference between py2app and the python Build Applet?
> Michael J. Lewis
I've never played with Build Applet, only py2app, so this may be partially or totally bogus, but py2app uses a fairly elaborate "setup" script that allows you to specify things like a custom icon (if you want one) as well as specific libraries. Build Applet, on the other hand, is a much simpler tool that takes a single source file, pulls in any "includes" it finds and builds a default. It might in fact be sufficient for your needs.
If you've downloaded the python from python.org, you will definitely find both the Build Applet and PythonLauncher in a PythonXX folder in your Applications folder.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor