PlatyPus the MacOSX Compiler

Ever wanted to compile your Python script or software into a MacOSX .app?  I have tried Py2App and I never seemed to get it working properly.  It would not import the modules I used in my application so upon launching it would give immediate error on the first imported module.  I really wanted to compile my app for Mac as I had already successfully used Py2Exe to compile it for windows.

I stumbled upon Platypus which was made by Sveinbjorn Thordarson.  Platypus interperetes several different languages and creates a native MacOSX application.  It wraps the script in an application bundle along with a native executable binary that runs the script.  Platypus supports several different languages other than Python like PHP, Perl, Expect, Ruby, Tcl, AppleScript, and some others.  Checkout the homepage for Platypus and you can see the additional features.

I hope by showing you below how easy Platypus is to use, that everyone will give it a try.  Its so simple.  Just to show you how easy Platypus is to use:

1. Write a script.

For demo purposes I wrote a simple little gui that has a label on it using the Tkinter module.

Screen Shot 2014-02-03 at 7.45.08 AM

2. Fire up Platypus.

Screen Shot 2014-02-03 at 7.46.09 AM

3. Configure for compile.

You provide:

  • The application name
  • Script type
  • Script path
  • Output
  • Version
  • Any extra configurable

Here is my configuration for the demo:

Screen Shot 2014-02-03 at 7.48.29 AM

4. Add an icon

From the advanced menu, you can choose an image file you would like to use as the application icon.

Screen Shot 2014-02-03 at 7.49.28 AM

5. Click “Create”

This will start compiling your .app.

Screen Shot 2014-02-03 at 7.50.29 AM

6. Test your .app

Its just that simple!  You now have a compiled .app for MacOSX in just 6 or so easy steps.  Forget trying to figure out Py2App!  Maybe someone can tell me how I can get my modules included when compiling with it.  I tried modifying the spec file and adding the imports but that also was a no cigar :(

Screen Shot 2014-02-03 at 7.51.30 AM





Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>