pyGUI & wake a sleeping Mac example.

I started playing around with pyGUI a year or two ago, which allows fast gui development on OS X, Windows, and Linux from Python. I wrote a little app to wake up Macs awhile back and packaged it as a standard Mac bundle. In theory the raw Python should run on Windows, but be aware that it utilizes arp.

This pyGUI app will wake a sleeping Macintosh with either an IP or MAC address. This is a very simple example of a basic window, textbox, and button in pyGUI.

Download WakeUp . Includes source and is public domain. Special thanks to Ocal who created the coffee cup icon I used.

Packaging a pyGUI Script On Mac.

If you’re unsure of how to package a Python App Bundle I’ll walk you through it now.

Install XCode. Create your Python program.

Right click your script and select Open With, Build Applet.App. Python version 2.6 would not work with pyGUI so I selected 2.5.

Now you need to right click your new app bundle and select Show Package Contents. Drill down into Resources folder. Copy the GUI folder in the pyGUI (I keep the pyGUI download handy on my desktop) lib and paste it into Resources.

Your app should run with a GUI now since it has the pyGUI libraries available.

To change the icon, just get an icon you like and use Icon Composer, which is in Utilities in the Development folder. Drag the image into the box and save as the same name as the icns in Resources in the app bundle. Copy over it and you’re set.

I have not tested bundling on Lion, but the bundled apps run fine.