Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 445
rjmunro Avatar asked Apr 02 '09 11:04

rjmunro


People also ask

How do I run a Python project in Xcode?

Now open Xcode and choose "Create a new Xcode project", in the resulting dialog select the "Other" tab and then "External Build System". Click "Next" and then enter your python project name and check the build tool is pointing to the correct python installation.

Can I write Python code in Xcode?

You totally can do Python coding in Xcode, but I've personally found Atom to be better for Python coding. There are so many packages that you can install in Atom to help you code, including linters, debuggers, docstring generators, autocompletion tools, and documentation searchers.

Can you import Python into Swift?

Swift For TensorFlow supports Python interoperability. You can import Python modules from Swift, call Python functions, and convert values between Swift and Python.


4 Answers

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.

like image 168
Barry Wark Avatar answered Oct 11 '22 12:10

Barry Wark


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.

like image 41
Wesley Avatar answered Oct 11 '22 11:10

Wesley


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.

like image 27
adrian Avatar answered Oct 11 '22 10:10

adrian


Also see:

http://lethain.com/entry/2008/aug/22/an-epic-introduction-to-pyobjc-and-cocoa/

like image 24
Evengers Avatar answered Oct 11 '22 12:10

Evengers