在 Mac(IDE?)上编写 Python 脚本的最佳方式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15592683/
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
Best way to write Python Scripts on a Mac (IDE?)
提问by TheCodingArt
I would love to find out what the best way to go about writing Python scripts on a Mac would be. I've gone through two ways (mind you, I'm trying to avoid using vim because I want an IDE rather bland text editor). I went through using PyDev in Eclipse (the more I went through their recommendations and steps, the more of a hassle everything seemed to be.. although I do have everything set up and it can compile.. I want to know if there's a better way. I'm not too fond of Eclipse as is) and I tried to set up Xcode through the following steps: Xcode4to run Python scripts. The problem with the Xcode version, is I would have to consistently setup the project like this every time. That, and every time I compiled something that needed to create a file it didn't (say using the command conn = sqlite3.connect('list.sqlite3'). Is there a simple way to do this? I've been trying to follow various iOS tutorials that want me to use python scripts (which I'm not familiar with at all) such as raywenderlich.comand Oreilly tutorials. Can anyone provide some guidelines on the best way to go about this?
我很想知道在 Mac 上编写 Python 脚本的最佳方式是什么。我经历了两种方式(请注意,我试图避免使用 vim,因为我想要一个 IDE 相当乏味的文本编辑器)。我在 Eclipse 中使用了 PyDev(我越是通过他们的建议和步骤,一切似乎就越麻烦......虽然我已经设置好了一切并且它可以编译......我想知道是否有更好的方式。我不太喜欢 Eclipse 原样),我尝试通过以下步骤设置 Xcode:Xcode4运行 Python 脚本。Xcode 版本的问题是我每次都必须像这样始终如一地设置项目。那,每次我编译一些需要创建文件的东西时,它没有(比如使用命令 conn = sqlite3.connect('list.sqlite3')。有没有一种简单的方法可以做到这一点?我一直在尝试遵循各种希望我使用 python 脚本(我根本不熟悉)的 iOS 教程,例如raywenderlich.com和 Oreilly 教程。谁能提供一些有关最佳方法的指南?
回答by Hywel
I think PyDev in Eclipse is pretty good. For scientific programming I wrote the following installation guide: http://hywelowen.org/installing-python-for-scientific-computing-on-osx/
我认为 Eclipse 中的 PyDev 非常好。对于科学编程,我编写了以下安装指南:http: //hywelowen.org/installing-python-for-scientific-computing-on-osx/
Spyder appears to be a decent alternative, but I haven't used it myself.
Spyder 似乎是一个不错的选择,但我自己没有使用过。
回答by erdekhayser
Personally, I prefer the one that is found on the official Python website, IDLE, which can be downloaded here. It is very easy to deal with, and with the Shell it offers an area to test things out on, it has more than Eclipse can offer- in my opinion. I'm sure that people would feel the complete opposite that I do, but with my experience, IDLE is the way to go.
就个人而言,我更喜欢在 Python 官方网站 IDLE 上找到的一种,可在此处下载。它非常容易处理,而且在 Shell 中,它提供了一个可以进行测试的区域,在我看来,它比 Eclipse 所能提供的更多。我相信人们会和我的感觉完全相反,但根据我的经验,IDLE 是要走的路。

