有没有好的 Python GUI shell?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/277170/
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
Is there a good Python GUI shell?
提问by Marcos Lara
I saw this the other day (scroll all the waydown to see some of the clever stuff):
我看到这个有一天(滚动一路下来,看到一些巧妙的东西):
http://www.mono-project.com/docs/tools+libraries/tools/repl/
http://www.mono-project.com/docs/tools+libraries/tools/repl/
And wondered whether something like this exists for Python.
并想知道 Python 是否存在这样的东西。
So, is there a good Python GUI shell that can do stuff like that C# shell can do?
那么,是否有一个很好的 Python GUI shell 可以做 C# shell 可以做的事情?
Edit: Here are links to screenshots from the article, showing what I'm interested in doing.
编辑:这里是文章截图的链接,显示了我感兴趣的事情。
An example of the type of things I'm interested:
我感兴趣的事物类型的一个例子:
http://www.mono-project.com/archived/images/7/75/GSharpPlot.png
http://www.mono-project.com/archived/images/7/75/GSharpPlot.png
They are able to add hooks to produce GUI elements like the plot, or even do silly things like:
他们能够添加钩子来生成图形等 GUI 元素,甚至可以做一些愚蠢的事情,例如:
http://www.mono-project.com/archived/images/b/bf/GSharpRenderHandler.png
http://www.mono-project.com/archived/images/b/bf/GSharpRenderHandler.png
I don't think this is possible with any of the console shells I've tried (the regular python shell, ipython).
我认为这对于我尝试过的任何控制台 shell(常规 python shell,ipython)都不可能。
Edit: I'm not looking for an IDE. If you look at the link, you'll get an idea of what I want.
编辑:我不是在寻找 IDE。如果你看一下链接,你就会知道我想要什么。
采纳答案by Brian
One project I'm aware of that provides similar features (inline plotting, customisable rendering) is Reinteract. Another (though possibly a bit heavyweight for general usage) is SAGEwhich provides functionality for web-based notebooks.
我所知道的一个提供类似功能(内联绘图、可自定义渲染)的项目是Reinteract。另一个(虽然对于一般用途可能有点重量级)是SAGE,它为基于 Web 的笔记本提供功能。
These aren't quite shells - they're designed more as a mathematical notebook (so for instance, you can modify an earlier result and have the change propogate to later calculations), but they're close to what you're looking for, and could probably be modified to be used as such.
这些并不是外壳——它们更像是一个数学笔记本(例如,您可以修改早期的结果并将更改传播到以后的计算中),但它们与您正在寻找的很接近,并且可能可以修改为这样使用。
回答by bendin
Have you looked at ipython? It's not quite as "gui". No smileys, sorry. ;-) It is a pretty good interactive shell for python though.
你看过ipython吗?它不像“gui”。没有笑脸,抱歉。;-) 不过,它是一个非常好的 Python 交互式 shell。
edit: I see you revised your question to emphasize the importance GUI. In that case, IPython wouldn't be a good match.
编辑:我看到您修改了您的问题以强调GUI的重要性。在这种情况下,IPython 不会是一个很好的匹配。
Might as well save you another blind alley: I went looking at DrPython hoping it would be similar to PLT's DrScheme, which looks comparable to example you've linked too. Unfortunately DrPython isn't all that much like DrScheme.
不妨为您节省另一条死胡同:我去看了 DrPython,希望它与 PLT 的 DrScheme 类似,它看起来与您链接的示例相似。不幸的是,DrPython 与 DrScheme 不太一样。
回答by Nye
(Sorry for thread necromancy, but this page still comes up highly in a Google search and I assume there must be some interest in the subject.)
(对于线程死灵法很抱歉,但该页面在 Google 搜索中的排名仍然很高,我认为一定有人对这个主题感兴趣。)
One GUI shell for Python which I believe is quite new is DreamPie. It doesn't quite go as far as the screenshots in the question, but it might be the closest available. They do at least highlight interactive graph plotting in their list of useful features.
我认为相当新的 Python GUI shell 是DreamPie。它并没有像问题中的屏幕截图那么远,但它可能是最接近的。他们至少会在有用的功能列表中突出显示交互式图形绘图。
回答by bouvard
As far as I know there is nothing out there that offers the sort of whiz-bang features that the Mono guys have implemented in their new shell, but that is not to say that the "basic" python interactive shell isn't a feature-complete and powerful application. I could see something like the C# shell being developed at some point, but I think as of today those features you're pointing to are reasonably unique. One might argue that this is because nobody thought of them or, alternatively, because nobody has really had a need for them. I tend to subscribe to the latter, although I suppose both are plausible.
据我所知,没有任何东西可以提供 Mono 人在他们的新 shell 中实现的那种令人惊叹的功能,但这并不是说“基本”python 交互式 shell 不是一个功能 -完整而强大的应用程序。我可以看到在某个时候正在开发类似 C# shell 的东西,但我认为截至今天,您所指的这些功能相当独特。有人可能会争辩说,这是因为没有人想到它们,或者,因为没有人真正需要它们。我倾向于赞同后者,尽管我认为两者都是合理的。
回答by Kai
You're looking for Reinteract, which is a Python-based shell that at least partially inspiredthe C# shell you found. It's definitely still in-development, but already very useful.
您正在寻找Reinteract,它是一个基于 Python 的 shell,它至少部分启发了您找到的 C# shell。它肯定仍在开发中,但已经非常有用。
回答by Eli Bendersky
I think that a combination of Pycrust with matplotlib can do exactly what you need. Pycrust is part of the wxPython installation, and matplotlib should be insalled separately. Both are simple to install in about 5 minutes.
我认为 Pycrust 与 matplotlib 的组合可以完全满足您的需求。Pycrust 是 wxPython 安装的一部分,matplotlib 应该单独安装。两者都可以在大约 5 分钟内轻松安装。
Read thisabout integrating matplotlib with Pycrust to produce dynamic plots like the ones in the link you posted.
阅读此有关集成matplotlib与Pycrust制作动态图像您发布的链接的人。
回答by user766479
DreamPieis my personal favorite. It doesn't appear to be any more restrictive than CSharpRepl. For example, the graph drawing example can be done if matplotlib is installed. There is an example screenshot to this effect on DreamPie's web site (http://dreampie.sourceforge.net/).
DreamPie是我个人的最爱。它似乎没有比 CSharpRepl 更具限制性。例如,如果安装了matplotlib,则可以完成图形绘制示例。DreamPie 的网站 ( http://dreampie.sourceforge.net/)上有一个关于这种效果的示例截图。
Bpython is similar, and I like it better. But it is only available on Linux as binary.
Bpython 类似,我更喜欢它。但它只能在 Linux 上作为二进制文件使用。
回答by rafaelcosman
Light Tableis working on this. The IDE is simultaneously a REPL -- it has in-line plotting with iPython.
Light Table正在致力于此。IDE 同时也是一个 REPL——它具有与 iPython 的内联绘图。