将现有的 python 项目导入到 XCode
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/709397/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Import an existing python project to XCode
提问by rjmunro
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.
我有一个 python 项目,我一直在用 vim 等在终端中制作。来自现有代码存储库的新 XCode 项目。
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.
其他开发人员正在不使用 XCode 进行项目工作 - 他们不介意我是否添加项目文件或其他内容,但他们会介意我是否必须重新组织整个事情。
回答by Barry Wark
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 TextMateas a text editor or Eclipse with PyDevas a more full-featured IDE.
我不认为将 Xcode 用于纯 python 项目是值得的。尽管 Xcode 编辑器对 Python 代码进行语法高亮显示,但 Xcode 并没有为您提供编写纯 Python 应用程序的任何其他好处。在 OS X 上,我会推荐TextMate作为文本编辑器或带有PyDev 的Eclipse作为功能更全面的 IDE。
回答by Wesley
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.
我建议不要这样做。在 Xcode 中创建组(看起来像文件夹)实际上并没有在文件系统中创建文件夹。这对模块层次结构造成了严重破坏。
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.
此外,Xcode 中的 SCM 集成非常笨拙。在习惯了在 Eclipse 中使用 Subversion 之后,Xcode 中的 Subversion 支持非常原始。在命令行上执行 svn 命令几乎更容易,所以很清楚发生了什么。
If you must use Xcode, use it to open individual py
files. Use it as a slow, relatively featureless text editor.
如果您必须使用 Xcode,请使用它打开单个py
文件。将其用作缓慢、相对无特色的文本编辑器。
If you must use Xcode for SCM, take a look at their guide to using Xcode with Subversion.
如果您必须将 Xcode 用于 SCM,请查看他们的将 Xcode 与 Subversion 结合使用的指南。
回答by Evengers
回答by adrian
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.
没有使用 Xcode 处理非 Cocoa Python 项目的特殊工具。因此,您可能只想使用“空项目”模板(在“其他”下)创建一个项目,然后拖入您的源代码。
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.
为方便起见,您可能希望在项目中设置一个可执行文件。您可以通过 ctrl/右键单击项目源列表并选择“添加”>“新建自定义可执行文件...”来执行此操作。你也可以添加一个目标,虽然我不确定这会给你带来什么。