Textmate & Running Python Scripts in Interactive Mode

Posted March 24th @ 6:11 pm  |  Filed in: OS X, Python    

So yeah, as I check out Emacs, I also checkout things in Textmate that I might not know about, and I’m learning that Textmate can do *lots* more cool stuff than I thought it could. One of those is (yes!) Textmate does have Python debugging built in (both PyCheckMate as well as the standard Python debugger are ready to go out of the box). And with a little tweaking, I can send a Python script I’m working on to the Terminal in interactive mode (Shift+Apple+R). Typically this command just runs the script in Terminal, but this little tweak leaves you in interactive mode.

Open the Textmate bundle editor. Go down to Python -> Run Script (Terminal) and replace this ( $(esc “${TPY}) ):

wpython

With this ( python -i ):

Textmate Python Interactive mode

Now, when you run this, your script will run, and you’ll be left with a Python prompt for playing around and further debugging.

No Comments Yet

You can be the first to comment!

Leave a comment

OpenID Login

Standard Login

Options:

Size

Colors