tags:

views:

1584

answers:

8

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

http://www.mono-project.com/CsharpRepl

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/files/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/files/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.

A: 

You are probably looking for an IDE. It was discussed here a few times, for example best gui python interpreter.

EDIT: Python installations include an interactive shell as default, no need for a special shell, missing in compiled C#. You may want to look at IronPython (or its Mono version).

This is a session from a Windows installation:

C:\IronPython-1.1.2>ipy -X:AutoIndent -X:ColorfulConsole -X:TabCompletion
IronPython 1.1 (1.1) on .NET 2.0.50727.3053
Copyright (c) Microsoft Corporation. All rights reserved.
>>> import clr
>>> import System
>>> from System import IO
>>> [f for f in IO.Directory.GetFiles('C:/')]
['C:/AUTOEXEC.BAT', 'C:/boot.ini', 'C:/CONFIG.SYS', 'C:/IO.SYS',
'C:/MSDOS.SYS', 'C:/NTDETECT.COM', 'C:/ntldr', 'C:/pagefile.sys']
>>>
gimel
None of those are similar to what I linked to...
Marcos Lara
The C# shell he pointed to has nothing at all to do with an IDE.
bouvard
That's not what I'm talking about. I added direct links to some screenshots from the original link to focus what I'm interested in.
Marcos Lara
+6  A: 

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  A: 

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
Yes, thanks, that's not what I'm looking for.
Marcos Lara
No smileys is a deal breaker. :P
titaniumdecoy
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
+8  A: 

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
Reinteract looks amazing! Thanks!
Marcos Lara
+3  A: 

Interactive pylab console.

J.F. Sebastian
That's part of matplotlib. I installed matplotlib and found a pylab module. If that's what you mean, you should probably mention it. :)PS: It's pretty sweet, thanks!
Marcos Lara
+2  A: 

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
Your link is broken.
Brian
+3  A: 

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
+2  A: 

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

Nye