问题描述
我有一点用 Python 开发小型命令行应用程序的经验.我想继续使用 Python 开发 GUI.在 Python 可用的 GUI 工具包中,我觉得最喜欢的是 wxPython 和 Tkinter;但我不想一直自己编写所有的 GUI.
I have a little experience developing small command-line applications with Python. I want to move on to developing GUIs with Python. From the available GUI toolkits for Python, the ones I feel the most inclined to are wxPython and Tkinter; but I don't want to code all of the GUI by myself all of the time.
这些工具包中是否有任何好的 GUI IDE?它不需要是免费的或开源的.
Are there any good GUI IDEs for any of these toolkits? It doesn't need to be free or open source.
推荐答案
我将只讨论 WxPython,因为它是我唯一使用过的工具包.TkInter 很适合编写小程序(然后它不需要 GUI 设计器),但并不适合大型应用程序开发.
I will talk only about WxPython because it's the only toolkit I have experience with. TkInter is nice to write small programs (then it doesn't require a GUI Designer), but is not really appropriate for large application development.
wxFormBuilder 非常好:它会生成您需要加载的
.XRC
文件在你的程序中,它可以在你使用时通过子类化来生成.py
文件.
wxFormBuilder is really good: it generates
.XRC
files you need to load in your program, and it can generate.py
files by subclassing them when you use.
DialogBlocks 和 wxDesigner 是两个商业软件,可以直接生成Python代码.由于价格原因,我没有对这些进行过多测试.
DialogBlocks and wxDesigner are two commercial software which can generate Python code directly. I didn't tested these much because of their price.
在尝试了所有这些之后,我意识到它们都有所有缺陷,没有什么比在编辑器中编写 GUI 更好的了.问题在于扩展的学习曲线.但是,与使用 GUI 设计器相比,您的速度会更快,代码也会更灵活.
After trying all these, I realized they had all flaws and that nothing is better than just writing the GUI in an editor. The problem is the extended learning curve. But then you will be much more faster and your code will be much more flexible than when using a GUI designer.
看看这个用 wxPython 编写的主要应用程序列表.您可能会看到这些都没有使用 GUI 设计器,这一定是有原因的.
Have a look at this list of major applications written with wxPython. You will probably see that none of these use a GUI Designer, there must be a reason for this.
然后你就会明白 gs 说你要么切换到 PyQt 要么你手动编写应用程序是正确的.我过去看过 Qt Designer 并认为这是我需要的.不幸的是,PyQt 有一些许可限制.
You then understand gs is right when saying that either you switch to PyQt or you write your application by hand. I had a look at Qt Designer in the past and thought this was what I needed. Unfortunately PyQt has some license restrictions.
这篇关于带有用于 wxPython 或 Tkinter 的 GUI 设计器的漂亮 IDE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!