tags:

views:

227

answers:

4

Could anyone tell me how to use pure Python without Cocoa support in Xcode? I can only find the Cocoa-Python template on the Internet.

Thanks in advance.

+7  A: 

If you are just trying to write pure Python command line tools, using Xcode is like using a big sledge hammer to hit a tiny nail, in other words, probably not the best tool for the job. There are some old posts out there about how to set up a pure Python Xcode project, like this one, but, in the end, you might be better off using an editor you're already familiar with, like emacs, or, if you don't mind spending a little bit of money, TextMate, all along with a free vcs like mercurial or git. Or take a look in MacPorts for those and other options.

Ned Deily
I personally prefer TextMate projects because of their flexibility. Plus, you don't actually have to have a "project" defined. You can just `cd` to the source tree and `mate .` to open the source tree into the project drawer of TextMate. One drawback is that you can't run the Python program directly from TextMate if it needs user input. I believe the developer is working on that though.
David Antaramian
I like TextMate projects as well. At least with the fairly recent Python plug-in I have installed, when running a Python program in TextMate, `raw_input()` opens a window with a text field for input.
Ned Deily
In addition to MacPorts, you might want to have a look at Fink, which is another package manager (http://www.aidanfindlater.com/2009/04/18/fink-vs-macports/).
EOL
A: 

Just about the best IDE for editing and running Python code is actually still emacs. The python-mode for emacs does a wonderful job of maintaining whitespace and, with a bit of configuration, emacs is truly a powerful editor.

Pretty radically different than your typical GUI editor, certainly, and some find it quite distasteful. I've personally used emacs, mostly, for editing Python since 1992 or so.

Google will reveal all, including a native version of Emacs for Mac OS X.

bbum
A: 

A lot of people like eclipse with PyDev for python, although I don't know how wel it works on OS X with apple's mishandling of java.

Roman A. Taycher
A: 

Even though I am using BBEdit, I found Wingware Python editor did a good job in exploiting the introspected data of Python modules. Purely designed for Python. Give it a try.

http://www.wingide.com/

Daehyok Shin