Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A .pyw file is a Python script that launches an application with a user interface, without a console window. I want to be able to double click a .pyw file in Finder in OSX to open that application, but when I right click and select Open With->Other I'm not allowed to select /usr/bin/python. It is greyed out even though I've enabled "All applications".

I assume this is because it will only let me select .app directories. It there any way to work around this so that I can open Python GUI applications without the terminal?

share|improve this question
up vote 1 down vote accepted

Use Automator to create an application like this:

Automator workflow for pythonw

The script in Run Shell Script above is (notice Pass Input as arguments):

/usr/bin/python "$@" > /dev/null 2>&1
exit 0

When saving it choose File Format Application (not Workflow). You could save it as /Applications/pythonw.

Then select a pyw file, press Command-I and select Open with>Other... and /Applications/pythonw. Then click Change All... and confirm with OK. The Get Info window should look like this:

Get Info pyw file

Now double click the pyw file and accept the warning (only the first time).

I've tested it with gui1.pyw:

from Tkinter import Label
widget = Label(None, text='Hello GUI world!') 

and worked like a charm.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.