Python in TextMate - run script in IDLE?

Is it possible for TextMate to run Python scripts in IDLE instead of internally or via terminal?

Rather than just using the Python assembly that comes with the IDLE installation, I want the shell window to actually start, so I can enter an interactive session.


source to share

1 answer

I had a game on OSX and I think it works for me.

Open the TextMate text editor ( Bundles

Bundle Editor

Show Bundle Editor


Left side: Expand Python

, then duplicate the Run Script command (bottom corner, second left button [++]) and name it Run Script in IDLE

Select a keyboard shortcut and place it in the box next to Activation : Key Equivalent

Replace the following line:["TM_PYTHON"] || "python", "-u", ENV["TM_FILEPATH"]) do |str, type|


from"/usr/bin/idle2.7", "-r", ENV["TM_FILEPATH"]) do |str, type|


This supplies your file path as an argument to standby, as if you were running /usr/bin/idle2.7 -r /path/to/

directly. (Or whatever version of python you are using - / usr / bin / idle3.1, etc.)

You can also use a flag -e

instead of a flag -r

to edit the Script in IDLE instead of running it.




All Articles