Friday, May 6, 2011

Import an existing python project to XCode

I've got a python project I've been making in terminal with vim etc.. I've read that XCode supports Python development at that it supports SVN (which I am using) but I can't find documentation on how to start a new XCode project from an existing code repository.

Other developers are working on the project not using XCode - They won't mind if I add a project file or something, but they will mind if I have to reorganise the whole thing.

From stackoverflow
  • I don't think it's worth using Xcode for a pure python project. Although the Xcode editor does syntax-highlight Python code, Xcode does not give you any other benefit for writing a pure-python app. On OS X, I would recommend TextMate as a text editor or Eclipse with PyDev as a more full-featured IDE.

    rjmunro : I'd like svn integration that I know Xcode has, and I thought it did at least some python code completion.
    Barry Wark : Both TextMate and PyDev (via Eclipse plugin) have SVN support. Xcode only does python completion for Objective-C methods (i.e. PyObjC). Both TextMate (via PySmell) and PyDev support genearal python code completion. Xcode is really not the best option.
  • There are no special facilities for working with non-Cocoa Python projects with Xcode. Therefore, you probably just want to create a project with the "Empty Project" template (under "Other") and just drag in your source code.

    For convenience, you may want to set up an executable in the project. You can do this by ctrl/right-clicking in the project source list and choosing "Add" > "New Custom Executable...". You can also add a target, although I'm not sure what this would buy you.

  • I recommend against doing so. Creating groups (which look like folders) in Xcode doesn't actually create folders in the filesystem. This wreaks havoc on the module hierarchy.

    Also, the SCM integration in Xcode is very clunky. After becoming accustomed to using Subversion with Eclipse, the Subversion support in Xcode is hopelessly primitive. It's almost easier to just do svn commands on the command line just so it's clear what's going on.

    If you must use Xcode, use it to open individual py files. Use it as a slow, relatively featureless text editor.

    If you must use Xcode for SCM, take a look at their guide to using Xcode with Subversion.

0 comments:

Post a Comment