[SciPy-user] shell for scipy

bryan cole bryan.cole at teraview.co.uk
Fri Jan 31 05:42:33 EST 2003


I use pycrust + scipy for interactive numerical work and I've been
thinking about how this combination could be improved:

What I think would be useful would be the ability to execute blocks of
code (say ~10 lines or so) at once. Right now, the various python shells
force you to execute code line-by-line. 

I would like to be able to craft data-analysis code in small blocks then
when I'm happy, press an "execute" button to run them, see the resulting
output then either move onto the next segment or re-edit the current one
and re-run it. Each segment would be automatically appended to a
python-file on execution, so I could "restore" to any previous point by
restarting the interpreter and re-executing the entire lot. There would
be a sort of "script history" function (like the command-history
function, but with code-blocks instead of single lines).

In general I prefer to do data-analysis from scripts, rather than
interactively at the command-line. The problem is at re-running the
python-process each time to test things out is slow because Scipy takes
so long to load each time (OK I'm impatient). Really, it would be better
just to keep the interpreter running between code-executions.

When I've got time, I'll try and implement something along these lines
using the wxPython. I'm not sure about embedding plots though.

I'd be happy to hear any comments/ideas on the above.

Bryan

On Thu, 2003-01-30 at 20:30, Fernando Perez wrote:
> On Tue, 28 Jan 2003 baecker at physik.tu-dresden.de wrote:
> 
> > In the longer run I think it would be nice
> > to have some kind of worksheet environment
> > (like in maple/mathematica/matlab...) which for example
> > also allows to embed the results of plots and
> > has a nice hierarchical help browser.
> > Would something like this for example be possible with
> > Scintilla (eg. under wxPython) ?
> > Are the any plans in this direction ?
> > 
> > Arnd
> > 
> > On Tue, 28 Jan 2003, Yann Le Du wrote:
> > 
> > > On 28 Jan 2003, Otto Tronarp wrote:
> > >
> > > > Perhaps IPython? Haven't used it my self, but I have heard good things
> > > > about it.
> > > > http://www-hep.colorado.edu/~fperez/ipython/
> > >
> > > Yes, I use it and find it excellent.
> 
> Thanks :)  Being the main ipython developer, I figured I might want to pitch 
> in a few words.  This message happens to coincide with me just having released 
> ipython 0.2.14 after 50 -pre releases.  I haven't announced it anywhere, as 
> I've been super busy this week. But the above-referenced url has the files 
> ready for download.
> 
> I think IPython is indeed quite nice, and in combination with a solid text 
> editor (Xemacs, vi, etc) I find it far better than idle. But of course, I'm 
> biased :)  However, for serious work I do think there are some things in 
> ipython which indeed make it better than the others:
> 
> - tight access to the underlying OS for shell-like operations. This is very 
> handy when doing data manipulation.
> 
> - the @pdb command to pop up pdb 'inside' crashed code.  This often is enough 
> for debugging and in my experience better/easier than stepping with a debugger 
> or putting in the proverbial print statements.
> 
> - the @run command, both for fast prototyping of modules (no reload issues) 
> and for profiling (-p gives direct profiler control).
> 
> - the embedding features for tricky debugging situations (think of the 
> .stop/.continue commands in IDL).
> 
> - the concept of profiles, which allows ipython to adapt to multiple 
> scenarios, even modifying its processing of the command-line syntax.
> 
> However, I also acknowledge that a graphical notebook-like interface would be 
> a great thing to have in many cases.  My mental model of the ideal pyhton 
> environment is Mathematica (even though their interface does have its rough 
> edges, I love the basic idea).  'math' opens a basic command-line interface, 
> while 'mathematica' gives you the notebook-based gui.  
> 
> That's exactly what I'd like to have for python: ipython as the command-line
> shell, and a gui which uses ipython as its interaction engine, but which can
> also save the whole session, edit across lines, embed graphics and change
> fonts, etc.
> 
> Such a project is fairly ambitious, but I'd like to pitch it here to see if
> there is community response. Mathematica, maple, matlab & IDL all have
> graphical desktops and for scipy to dethrone the last two of them, it will 
> probably need one too (I say the last two because I don't see scipy as 
> competing with Mathematica, but definitely as a better environment than matlab 
> or IDL).
> 
> Currently ipython is fairly solid and stable, but in need of a big internal 
> cleanup.  I'm very hesitant to do much to it right now, because if the idea of 
> coordinating with a graphical shell does get support from the scipy community, 
> then the project will become larger.  In that case, the redesign of the 
> current internals should be done with an eye on making it easy to drop ipython 
> into any graphical shell (the mythical scipy graphical shell, idle, the new 
> Eric editor, whatever...)
> 
> I would therefore like to hear from the scipy users/developers about interest 
> on this topic.  I honestly think that ipython provides some of the most solid 
> low-level interface of all the current python shells, but it's text only.  I 
> definitely can't do the work of writing a large graphical layer above it, but 
> I'd be more than happy to coordinate witha  larger team for the necessary 
> rewrites.
> 
> If there is no interest, ipython will probably continue to slowly improve 
> (it's quite good already and for text-only use I have very few things I see as 
> needed improvements).  But without larger community support I doubt I will be 
> able to devote any major amount of time to it.
> 
> Best regards,
> 
> Fernando.
> 
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
-- 
Bryan Cole
Teraview Ltd., 302-304 Cambridge Science Park, Milton Road, Cambridge CB4 0WG, United Kingdom.
tel: +44 (1223) 435380 / 435386 (direct-dial) fax: +44 (1223) 435382




More information about the SciPy-User mailing list