13

I saw this the other day (scroll all the way down to see some of the clever stuff):

http://www.mono-project.com/docs/tools+libraries/tools/repl/

And wondered whether something like this exists for Python.

So, is there a good Python GUI shell that can do stuff like that C# shell can do?

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

They are able to add hooks to produce GUI elements like the plot, or even do silly things like:

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).

Edit: I'm not looking for an IDE. If you look at the link, you'll get an idea of what I want.

Alexander Köplinger
  • 2,477
  • 14
  • 15
Marcos Lara
  • 1,845
  • 5
  • 18
  • 20
  • How about updating your question to describe your use case. What do you want to do? What do you want the system to do in response? The pictures are just pictures, and -- obviously -- hard to interpret into a use case. Don't say what you don't want. Say what you want. – S.Lott Nov 10 '08 at 11:19
  • Why the hangup on it being a GUI? – Jeremy Cantrell Nov 10 '08 at 15:18
  • @S.Lott: Add hooks/builtins to display graphics inline, is one way to describe the pictures I linked to. – Marcos Lara Nov 10 '08 at 21:18
  • I don't think you can do GTK-ish graphics in the console... – Marcos Lara Nov 10 '08 at 21:19
  • @Marcos: He is looking for a separate interpreter that would make it possible, not a way of integrating it into the console. This is absolutely possible with a read-eval-print loop such as the Mono C# shell uses, it just has not been done. – bouvard Nov 11 '08 at 00:50
  • @Marcos: It would probably be somewhat achievable even on a console, (at least for an xterm, or framebuffer implemented one). Take a look at w3m's image support for instance. – Brian Nov 11 '08 at 15:49

8 Answers8

13

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 SAGE which provides functionality for web-based notebooks.

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.

Brian
  • 107,377
  • 28
  • 104
  • 109
7

Have you looked at ipython? It's not quite as "gui". No smileys, sorry. ;-) It is a pretty good interactive shell for python though.

edit: I see you revised your question to emphasize the importance GUI. In that case, IPython wouldn't be a good match.

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.

bendin
  • 9,096
  • 1
  • 37
  • 37
  • 2
    Who says no smileys! sys.displayhook=lambda x:sys.stdout.write(([':-(',':-)'][x] if isinstance(x,bool) else repr(x)) + '\n') You could even use u'\u2639\u263a'[x] on a unicode supporting console. – Brian Nov 11 '08 at 08:39
  • @MarcosLara: there are `jupyter qtconsole` and [jupyter notebooks](http://jupyter.org/). [ipython](https://ipython.org/) is a kernel for jupyter. – jfs Sep 15 '17 at 06:24
6

(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.)

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.

Community
  • 1
  • 1
Nye
  • 437
  • 5
  • 6
  • This question still comes up highly on Google and the latest DreamPie looks like it may be a better alternative to Reinteract (voted up!). – MadChuckle Mar 09 '12 at 20:15
6

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.

bouvard
  • 3,766
  • 22
  • 28
3

You're looking for Reinteract, which is a Python-based shell that at least partially inspired the C# shell you found. It's definitely still in-development, but already very useful.

Kai
  • 4,970
  • 4
  • 25
  • 34
2

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.

Read this about integrating matplotlib with Pycrust to produce dynamic plots like the ones in the link you posted.

Eli Bendersky
  • 231,995
  • 78
  • 333
  • 394
1

DreamPie is 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/).

Bpython is similar, and I like it better. But it is only available on Linux as binary.

rafaelcosman
  • 2,185
  • 7
  • 20
  • 37
user766479
  • 11
  • 1
0

Light Table is working on this. The IDE is simultaneously a REPL -- it has in-line plotting with iPython.

rafaelcosman
  • 2,185
  • 7
  • 20
  • 37