matlab, idle, interactivity and teaching

Giorgio -

Thanks for starting this discussion and sorry for the late reply.
Use of Python with matplotlib in the classroom and by students in general is a major objective of mine.

I use IDLE with numpy, scipy, and matplotlib.

The IDLE problem is really annoying though. Starting with -n is required (a strange hack for many students), and then you cannot restart the interpreter.
I keep hoping that the IDLE developers will be able to change the code such that this is not necessary anymore.

Another difficulty is that it is cumbersome to change directories. In that respect, it would be great if pylab had a change directory (cd) command. That would make interactive use a lot easier. This could also be an IDLE feature of course.

Another question I get from matlab users is why there isn’t a ‘whos’ to figure out all the variables that are used. This is really an interactive issue, where the IDLE would be used as an interpreter (calculator really), not as a means to develop serious code.

So to summarize, I think getting matlab users switched over, I see the following three issues high on the list:

  1. Get rid of the -n problem for running matplotlib interactively.
  2. Make an easy cd command.
  3. Make an who option.

On the bright side, I get quite a few people converted that don’t want to go back anymore…

Mark

···

Message: 7
Date: Wed, 28 Mar 2007 16:58:42 +0200
From: Giorgio Luciano <giorgio.luciano@…1376…>
Subject: [Matplotlib-users] matlab, idle, interactivity and teaching

To: Discussion of Numerical Python <numpy-discussion@…177…>,
matplot <matplotlib-users@lists.sourceforge.net

, SciPy Users List
<scipy-user@…177…>
Message-ID: <460A82A2.90602@…1376…>

Content-Type: text/plain; charset=ISO-8859-15; format=flowed

Hello to all,
I’ve thread that apperead some time ago on this list about matlab and
teaching.
I’ve discovered python recently and translated part of the routine I

use in python (www.chemometrics.it).
Some of my collegue asked me if I could show them how to use python. For
matlab user I guess the first problem is to setup everything, but I just

fixed it preparing a directory with all the package I need and a
matplotlibrc file for interactive mode + a shortcut for idle -n use.
The second problem is that people now wants some bells and whistles of
matlab that I have to admit sometime can be very helpful for saving

time. The bells and whistles are about the workspace.
It’s difficult to cut and paste from gnumeric/excel (I generally use txt
file but it’s no so immediate) and also there is no “visual” workspace.

I cannot succeed also in saving workspace (I know there is a function so
iosave.mat but I didn’t manage easily hot to use it)
For overpass this problems I’ve tried to use QME-DEV which is in early
stage of development (alpha) but promise well.

What people like of python/matplot/scipy
-its free :wink:
-they like a lot the plotting style and capabilities (they find the png
and svg file very clear and accurate)
-they like IDLE as editor (ehy it’s has the same color of matlab :wink: ! )

So my question is . Do you have a similar experience ?
How do you help people in moving the first step ?
do you use (and also does it exist) a more friendly environment than
IDLE except from QME-DEV.

I know that this question may look silly, but in my opinion also how
much is user friendly a software is very important for getting new users.
Cheers to all
Giorgio

Have you looked at iPython? I think it's a great way
to go. Check it out.

···

--- Mark Bakker <markbak@...287...> wrote:

Giorgio -

Thanks for starting this discussion and sorry for
the late reply.
Use of Python with matplotlib in the classroom and
by students in general is
a major objective of mine.

I use IDLE with numpy, scipy, and matplotlib.

The IDLE problem is really annoying though.

[cut]

-- Lou Pecora, my views are my own.
---------------
"I knew I was going to take the wrong train, so I left early."
--Yogi Berra

____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

I always thought ipython didn’t come with a good editor.
Am I mistaken?
Mark

···

On 3/30/07, Lou Pecora < lou_boog2000@…9…> wrote:

Have you looked at iPython? I think it’s a great way

to go. Check it out.

— Mark Bakker <markbak@…287…> wrote:

Giorgio -

Thanks for starting this discussion and sorry for
the late reply.

Use of Python with matplotlib in the classroom and
by students in general is
a major objective of mine.

I use IDLE with numpy, scipy, and matplotlib.

The IDLE problem is really annoying though.

[cut]

– Lou Pecora, my views are my own.

“I knew I was going to take the wrong train, so I left early.”
–Yogi Berra


Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

Oh, I see. You probably want an development
envirnoment. Sorry. IPython is great for
interactively running code, but not too great for any
editing. I do my editing in a separate source-code
editor (BBEdit on the Mac). That works well for me
since the editor can also run Python scripts in a
Terminal window. There are some other products out
there (although I haven't tried them). Two that come
to mind are SPE (I think that's the name) and Wings, a
commercial product that gets a lot of praise. Give
them a look.

-- Lou Pecora, my views are my own.

···

--- Mark Bakker <markbak@...287...> wrote:

I always thought ipython didn't come with a good
editor.
Am I mistaken?
Mark

---------------
"I knew I was going to take the wrong train, so I left early."
--Yogi Berra

____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091

Mark,

you can set ipython (in the ipythonrc.ini) to start up the editor of your
choice when you type "edit" in the ipython-shell.

Check out this video at ShowMeDo, that shows a lot of the features of
ipython:
http://showmedo.com/videos/video?name=DownloadingIPythonForMSWindows&fromSeriesID=2

Oliver

···

matplotlib-users-bounces@lists.sourceforge.net wrote on 30.03.2007 16:48:24:

I always thought ipython didn't come with a good editor.
Am I mistaken?
Mark

On 3/30/07, Lou Pecora < lou_boog2000@...9...> wrote:
Have you looked at iPython? I think it's a great way
to go. Check it out.

--- Mark Bakker <markbak@...287...> wrote:

> Giorgio -
>
> Thanks for starting this discussion and sorry for
> the late reply.
> Use of Python with matplotlib in the classroom and
> by students in general is
> a major objective of mine.
>
> I use IDLE with numpy, scipy, and matplotlib.
>
> The IDLE problem is really annoying though.

[cut]

-- Lou Pecora, my views are my own.
---------------
"I knew I was going to take the wrong train, so I left early."
--Yogi Berra

____________________________________________________________________________________

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo!

Games.

http://videogames.yahoo.com/platform?platform=120121
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share

your

opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

You can run ipython _from_ emacs. Needs a bit of messing about with
your .emacs, but once you've set it up, it works very well. Object
introspection and the debugger are very nice; you can execute code
fragments etc. Not quite a 'development environment', but a long way
towards one.

It explains how to do set it up in the ipython manual.

George Nurser.

···

matplotlib-users-bounces@lists.sourceforge.net wrote on 30.03.2007 > 16:48:24:

> I always thought ipython didn't come with a good editor.
> Am I mistaken?
> Mark

> On 3/30/07, Lou Pecora < lou_boog2000@...9...> wrote:
> Have you looked at iPython? I think it's a great way
> to go. Check it out.
>
> --- Mark Bakker <markbak@...287...> wrote:
>
> > Giorgio -
> >
> > Thanks for starting this discussion and sorry for
> > the late reply.
> > Use of Python with matplotlib in the classroom and
> > by students in general is
> > a major objective of mine.
> >
> > I use IDLE with numpy, scipy, and matplotlib.
> >
> > The IDLE problem is really annoying though.
>
> [cut]
>
> -- Lou Pecora, my views are my own.
> ---------------
> "I knew I was going to take the wrong train, so I left early."
> --Yogi Berra
>
____________________________________________________________________________________

> Be a PS3 game guru.
> Get your game face on with the latest PS3 news and previews at Yahoo!
Games.
> http://videogames.yahoo.com/platform?platform=120121
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> matplotlib-users List Signup and Options

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Not quite a 'development environment', but a long way
towards one.

I always thought that the focus of matplotlib towards matlab-like interactivity is fundamentally flawed. Matlab-like interactivity is damn good when it is needed, but for that purpose in the free world there are already the good Octave, Gnuplot and Scilab.

The big strength of matplotlib is that it is Python -that is, it is built on top of a general purpose language that is both very powerful and a breeze to code with.

I would like to see matplotlib being pushed as a scientific plotting development library and environment, with pylab being a nice add-on for people accustomed with python and wanting a python-friendly interactive plot. Today matplotlib is marketed viceversa, and in my opinion this confuses newcomers (that see a programming language being used as an interactive command line environment) and doesn't help who wants to use matplotlib as what it is -a python library- with full power (I was *extremly* confused when I started to dig matplotlib to build a wx application and *everything* I found starting with was a reference to pylab...)

So, coming back to Giorgio question, I'd like to advice him to teach matplotlib+scipy to his students as a programming environment first, letting them learn Python, and *after* showing them that there is a pythonic interactive environment.

m.

···

--
Massimo Sandal
University of Bologna
Department of Biochemistry "G.Moruzzi"

snail mail:
Via Irnerio 48, 40126 Bologna, Italy

email:
massimo.sandal@...898...

tel: +39-051-2094388
fax: +39-051-2094387

You are not mistaken, and this is by design: ipython is not an IDE,
it's the interactive component of a python workflow.

As others have mentioned (thanks to all, btw), it has limited support
for specifying your editor and a special command called %edit. Many
people find this very useful, which is why I added it. Personally I
don't use that at all. My workflow consists of an open Emacs session
(with multiple frames, typically) and a terminal with ipython in it.
I do the heavy-duty editing in Emacs (replace with vi, IDLE, Komodo or
any other editor of your preference), save, and then run the code in
the terminal via

run filename

Since ipython has history that backtracks on what you've typed so far,
this normally just requires typing 'r' and then 'up-arrow' once. I
personally don't find it any more cumbersome than hitting some F-key
in an IDE, and I get the power of Emacs with the comfort of a good
terminal (Konsole in my case).

Others have mentioned how ipython can also be used *inside* emacs,
which can be very handy for complex debugging. It's not my daily
environment because I prefer Konsole to the emacs terminal, but it is
certainly a good way to work for many.

IPython comes from the Unix tradition of 'do one thing well and let
users work whichever way they want' rather than the windows approach
of 'provide a single, fully integrated mega-app'. So it is easy to
use ipython with your personal combination of editor and terminal
emulator, but it does NOT provide the kind of IDE feel many expect
these days. Whether this particular balance is a feature or a
drawback is largely dependent on personal preference, I think.

We are currently refactoring ipython in a way that will make it very
easy to embed all of its functionality into the terminal component of
an IDE. So hopefully in the future, this discussion won't have to
happen: I'll be able to use ipython the way I do today, but it will
become possible for IDE authors to incorporate it in their own
environments.

Until then, it's worth understanding the pros and cons of using
ipython so you can decide whether you find its approach comfortable
for your style.

Regards,

f

···

On 3/30/07, Mark Bakker <markbak@...287...> wrote:

I always thought ipython didn't come with a good editor.
Am I mistaken?

I would have to agree with most of what Massimo said.
When I started using matplotlib I also learned some
wxPython stuff because I thought that was needed. Not
a bad thing to learn, but then all the pylab
references confused me. Finally, I got it straight
and almost always start with import pylab now. I
suspect matplotlib started out with the dream of
replacing some part of MatLab, but then morphed into a
nice plotting library for Python. The documentation
has not shaken off that dream.

Certainly, using pylab/matplotlib, iPython, and SciPy
one can go vary far in getting MatLab-like
environment. But that combination (or something
similar) is needed beyond matplotlib.

Massimo is right, the real gain is Python in
combination with nice usable libraries for
scientific/technical programming. Don't confuse the
newbies.

···

--- massimo sandal <massimo.sandal@...898...> wrote:

> Not quite a 'development environment', but a long
way
> towards one.

I always thought that the focus of matplotlib
towards matlab-like
interactivity is fundamentally flawed. Matlab-like
interactivity is damn
good when it is needed, but for that purpose in the
free world there are
already the good Octave, Gnuplot and Scilab.

The big strength of matplotlib is that it is Python
-that is, it is
built on top of a general purpose language that is
both very powerful
and a breeze to code with.

I would like to see matplotlib being pushed as a
scientific plotting
development library and environment, with pylab
being a nice add-on for
people accustomed with python and wanting a
python-friendly interactive
plot. Today matplotlib is marketed viceversa, and in
my opinion this
confuses newcomers (that see a programming language
being used as an
interactive command line environment) and doesn't
help who wants to use
matplotlib as what it is -a python library- with
full power (I was
*extremly* confused when I started to dig matplotlib
to build a wx
application and *everything* I found starting with
was a reference to
pylab...)

So, coming back to Giorgio question, I'd like to
advice him to teach
matplotlib+scipy to his students as a programming
environment first,
letting them learn Python, and *after* showing them
that there is a
pythonic interactive environment.

m.
--
Massimo Sandal

-- Lou Pecora, my views are my own.
---------------
"I knew I was going to take the wrong train, so I left early."
--Yogi Berra

____________________________________________________________________________________
Looking for earth-friendly autos?
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/

As for a good IDE. I really like eclipse with pydev. For easy student/beginner setup, easyclipse has a nice python eclipse distribution

http://www.easyeclipse.org/site/distributions/index.html

I think I've tried near every python IDE setup out there over the last couple years, and this one wins for me.

tim

···

Thank for all the reply.
I will sure have a look at the video that Oliver suggest and I also downloaded Eclipse.
I'm "happy" that someone also shared my problems in teaching python.
I'm aware that python/scipy were not started as a clone matlab (well matlibplot was started as something similar :wink:
and also that they should be taught as an language (and that's why I prefer to use it an not to shol very useful programs like OCTAVE od Scilab.. it's better for students to hava a curriculum with a true programming language than with a metalanguage).
I have to admit also that if someone there sooner or later would create a workspace similar to matlab (with paste and copy, and more interactive feature without tweaking too much) a lot more people would be glade to replace their matlab with scipy/matplotlib.

Giorgio

Giorgio Luciano ha scritto:

I'm aware that python/scipy were not started as a clone matlab (well matlibplot was started as something similar :wink:

Yes, matplotlib AFAIK wanted (and probably wants) to be something similar, and it's bad, because mpl is too good in itself to be forced to be just a matlab ripoff! :slight_smile:

and also that they should be taught as an language (and that's why I prefer to use it an not to shol very useful programs like OCTAVE od Scilab.. it's better for students to hava a curriculum with a true programming language than with a metalanguage).

That's really good and I fully agree.

I have to admit also that if someone there sooner or later would create a workspace similar to matlab (with paste and copy, and more interactive feature without tweaking too much) a lot more people would be glade to replace their matlab with scipy/matplotlib.

A pythonic interacting environment IMHO should be a nice application in itself to write. It should have its own shell instead of relying on ipython (that is, it should not be a python shell, or a python shell *really* on steroids). I'd like to hear the pylab guys to know what they think.

m.

···

--
Massimo Sandal
University of Bologna
Department of Biochemistry "G.Moruzzi"

snail mail:
Via Irnerio 48, 40126 Bologna, Italy

email:
massimo.sandal@...898...

tel: +39-051-2094388
fax: +39-051-2094387

A really great IDE for windows users is pyScripter (
http://mmm-experts.com/Products.aspx?ProductId=4 )
It's probably the best I could try so far (and it's free).

cheers

···

On 3/30/07, Tim Hirzel <hirzel@...1209...> wrote:

As for a good IDE. I really like eclipse with pydev. For easy
student/beginner setup, easyclipse has a nice python eclipse distribution

http://www.easyeclipse.org/site/distributions/index.html

I think I've tried near every python IDE setup out there over the last
couple years, and this one wins for me.

tim
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

I have to agree with Giorgio in general. Unfortunately, the threading support required by matplotlib isn't implemented in pyScripter, which means that it's a nice environment until you want to do some plotting, when it becomes a bit flaky. I haven't checked eclipse's behaviour with matplotlib.

Gary R.

Giorgio F. Gilestro wrote:

···

A really great IDE for windows users is pyScripter (
http://mmm-experts.com/Products.aspx?ProductId=4 )
It's probably the best I could try so far (and it's free).

cheers

On 3/30/07, Tim Hirzel <hirzel@...1209...> wrote:

As for a good IDE. I really like eclipse with pydev. For easy
student/beginner setup, easyclipse has a nice python eclipse distribution

http://www.easyeclipse.org/site/distributions/index.html

I think I've tried near every python IDE setup out there over the last
couple years, and this one wins for me.

tim

I've had similar problems running wxPython code under certain IDEs where things can go very poorly (dramatic crashing, or it just wont execute). At least with the wx or wxagg backends, I have no trouble running matplotlib demos such as "ellipse_demo.py" from inside eclipse+pydev.

-tim

Gary Ruben wrote:

···

I have to agree with Giorgio in general. Unfortunately, the threading support required by matplotlib isn't implemented in pyScripter, which means that it's a nice environment until you want to do some plotting, when it becomes a bit flaky. I haven't checked eclipse's behaviour with matplotlib.

Gary R.

Giorgio F. Gilestro wrote:
  

A really great IDE for windows users is pyScripter (
http://mmm-experts.com/Products.aspx?ProductId=4 )
It's probably the best I could try so far (and it's free).

cheers

On 3/30/07, Tim Hirzel <hirzel@...1209...> wrote:
    

As for a good IDE. I really like eclipse with pydev. For easy
student/beginner setup, easyclipse has a nice python eclipse distribution

http://www.easyeclipse.org/site/distributions/index.html

I think I've tried near every python IDE setup out there over the last
couple years, and this one wins for me.

tim
      
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options