0

I apologize for such a basic question. I've done some research online and still cannot figure out for the life of me how to turn a python folder into something like an actual app I can open in OS X. I am using Mac OS X, Terminal and Coderunner for my Python project.

2
  • Can you be more specific about what you mean by "actual app"? The answer will depend on that. Commented Aug 27, 2013 at 18:55
  • 1
    What do you mean, python folder into an app? Commented Aug 27, 2013 at 18:57

2 Answers 2

3

Here are a few options:

  • Platypus is not Python-specific. It lets you wrap a simple GUI around a command line tool.
  • py2app is Python-specific and a good choice if you have a GUI, or need to run in the background.
  • PyInstaller is similar to py2app but cross-platform; I've never used it, so I don't know how well it works.

The right choice depends on what your program does; who is the expected audience — do you need to redistribute it, if so how, and so forth. If you want to make the application entirely self-contained — not dependent on anything else beyond the OS — then things get more complicated (though certainly not insoluble; there are several commercial Mac desktop apps written in Python.)

Sign up to request clarification or add additional context in comments.

6 Comments

I'd like to add cx_Freeze to the list which is cross platform: cx-freeze.sourceforge.net
It'd be really interesting to see if someone could compare cx_Freeze, PyInstaller and py2app. cx_Freeze doesn't even mention the Mac on its home page, which probably accounts for its lack of visibility!
It actually does mention it: "cx_Freeze is cross platform and should work on any platform that Python itself works on"
As for the comparison, there's something here: spreadsheets.google.com/….
I get an error trying to go to that URL. (I was referring to explicit mention of the Mac on that page.)
|
0

Typically you would make the script executable by putting

#!/usr/bin/env python

as the first line, and then in a terminal window typing

chmod u+x myscript.py

You might also want to put it in a special scripts folder and then add that to your PATH by editing .bash_profile. (I am putting a lot of buzz-words here to help you find the tutorials explaining how these things work.)

You can wrap your script into an Automator object if you want to try running it that way, but in the long run you will be better off getting comfortable working in a terminal window.

It would also help to know what your app does: Process files, generate a GUI, do a calculation, etc...

3 Comments

I guess what I mean is if I make a python program with a GUI, how do I then turn that into it's own application that someone else with a mac could install into their applications folder and run.
I'm not sure if beroe just answered my question.
If you want to make a GUI, you would probably want to learn some of the tools listed here or those listed in @Nicolas_Riley's answer. My suggestion will cover a fair percentage of data-processing-type tasks (including user interaction), but only when used at the command line. I guess I wouldn't give up on terminal-based scripts until you must.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.