您使用哪种 IDE(如果有)构建 Python GUI 项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/285132/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 19:49:03  来源:igfitidea点击:

With what kind of IDE (if any) you build python GUI projects?

pythonuser-interfaceide

提问by Ali Afshar

Is there any IDE (like VS) with drag and drop support for building python GUI, connecting to dbs etc? Eventhough I am an emacs guy, I find it much easier to create GUI with VS.

是否有任何 IDE(如 VS)支持拖放构建 python GUI、连接到 dbs 等?尽管我是一个 emacs 人,但我发现使用 VS 创建 GUI 要容易得多。

回答by bouvard

The short answer is "no". There is not a swiss-army-knife like IDE that is both a full-featured Python code-editor and a full-featured WYSIWYG GUI editor. However, there are several stand-alone tools that make creating a GUI easier and there are a myriad of code editors, so if you can handle having two windows open, then you can accomplish what you are trying to.

最简洁的答案是不”。没有像 IDE 那样既是全功能 Python 代码编辑器又是全功能 WYSIWYG GUI 编辑器的瑞士军刀。但是,有几个独立的工具可以更轻松地创建 GUI,并且有无数的代码编辑器,因此如果您可以处理打开两个窗口的情况,那么您就可以完成您的任务。

As for stand-alone GUI editors, which you choose is going to depend on what library you choose to develop your GUI with. I would recommend using GTK+, which binds to Python via PyGtkand has the GladeGUI designer. I believe that there are other GUI libraries for Python that have WYSIWYG designers (Qt, Tkinter, wxWindows, etc.), but GTK+ is the one I have the most experience with so I will leave the others for other commentators.

至于独立的 GUI 编辑器,您选择哪个将取决于您选择用来开发 GUI 的库。我建议使用GTK+,它通过PyGtk绑定到 Python并具有GladeGUI 设计器。我相信还有其他的 Python GUI 库有 WYSIWYG 设计器(Qt、Tkinter、wxWindows 等),但 GTK+ 是我最有经验的,所以我会把其他的留给其他评论员。

Note, however, that the designer in this case is not at all language dependent. It just spits out a .glade file that could be loaded into any language that has GTK+ bindings. If you are looking for a designer that produces raw Python code (like the Code-Behind model that VS.Net uses), then I am not aware of any.

但是请注意,这种情况下的设计者完全不依赖于语言。它只是输出一个 .glade 文件,该文件可以加载到任何具有 GTK+ 绑定的语言中。如果您正在寻找生成原始 Python 代码的设计器(如 VS.Net 使用的代码隐藏模型),那么我不知道任何。

As for general code-editing IDE's (that do not include a GUI designer), there are many, of which PyDev/Eclipseis probably the most Visual Studio-like.

至于通用的代码编辑 IDE(不包括 GUI 设计器),有很多,其中PyDev/ Eclipse可能是最像 Visual Studio 的。

(Revised for clarity.)

(为清楚起见进行了修订。)

回答by Brandon

For GUI only, I find VisualWx (http://visualwx.altervista.org/) to be very good for designing wxPython apps under Windows.

仅对于 GUI,我发现 VisualWx ( http://visualwx.altervista.org/) 非常适合在 Windows 下设计 wxPython 应用程序。

For GUI + database, dabo (http://dabodev.com/) is probably a good answer.

对于 GUI + 数据库,dabo ( http://dabodev.com/) 可能是一个不错的答案。

回答by Ali Afshar

Also for PyGTK, there is Gazpacho, it's pure python which makes adding your own custom widgets easier, and already has gtkbuilder support.

同样对于 PyGTK,还有Gazpacho,它是纯 python,可以更轻松地添加您自己的自定义小部件,并且已经具有 gtkbuilder 支持。

I took over maintenance of the project a few months ago, and we plan to release it under the umbrella of the PIDA IDE, in a more Visual Studio-like setup. Patches accepted!

几个月前我接手了这个项目的维护工作,我们计划在PIDA IDE的保护伞下发布它,在一个更像 Visual Studio 的设置中。补丁已接受!

回答by Sherm Pendley

I'm not really a Pythonista, but I ama Mac user and I appreciate a good, native interface in the apps I write and use. So, if I were to use Python for a GUI app on the Mac, I'd use PyObjC with Interface Builder and Xcode, rather than a cross-platform solution.

我不是真正的 Pythonista,但我Mac 用户,我很欣赏我编写和使用的应用程序中良好的原生界面。因此,如果我要在 Mac 上将 Python 用于 GUI 应用程序,我会使用带有 Interface Builder 和 Xcode 的 PyObjC,而不是跨平台解决方案。

回答by deadcyclo

If your into QT EricIDEis a good choice

如果你进入 QT EricIDE是一个不错的选择

回答by Joel Coehoorn

Eclipsehas python support.

Eclipse有 python 支持。

There's also IDLEor Wingware, though I'm not sure of their GUI support.

还有IDLEWingware,但我不确定它们的 GUI 支持。

I'm sure a good google searchwould turn up more.

我相信一个好的谷歌搜索会出现更多。

But in the end, I doubt it. Python is dependent on third-party widget sets like Qt, Tk, Gtk, wxWidgets, etc for GUI support. Each of those will have their own system for laying things out.

但最终,我对此表示怀疑。Python 依赖于第三方小部件集,如 Qt、Tk、Gtk、wxWidgets 等以提供 GUI 支持。每个人都有自己的系统来布置东西。

回答by PabloG

You can try Boa Constructoror Dabo

你可以试试Boa ConstructorDabo

回答by Jeremy Cantrell

I'm a GNOME guy, so I prefer PyGTK. The standard GUI builder for that is the Glade Interface Designer(until it transitions to GtkBuilder).

我是一个 GNOME 人,所以我更喜欢 PyGTK。标准的 GUI 构建器是Glade Interface Designer(直到它转换为 GtkBuilder)。

回答by Toni Ru?a

For wxPythonI use xrcedto make GUI definitions contained in xml files, I find this way to be elegant and scalable.

对于wxPython,我使用xrced来创建包含在 xml 文件中的 GUI 定义,我发现这种方式优雅且可扩展。

wxformbuilderis also good.

wxformbuilder也不错。

As for the IDE, I'm a WingIDEfan.

至于 IDE,我是WingIDE 的粉丝。