On Fri, Oct 5, 2012 at 10:47 AM, Usjes <oisin...@yahoo.co.uk> wrote:

> Benjamin Root-2 wrote
> > On Fri, Oct 5, 2012 at 6:38 AM, Usjes <
>
> > oisin_nz@.co
>
> > > wrote:
> >
> > Does it fail for the example I originally gave?
> >
> > from pylab import *
> > plot([1, 2, 3])
> > savefig("foobar.emf")
> >
> >
> > Ben Root
>
> Yes, it fails even with the simple plot suggested; see log below. I am new
> to Python but I did also try inserting the command:
> print rgb
> preceding the offending line, to get an idea of what the dimensions of
> 'rgb'
> are but the print statement also fails due to 'too many values to unpack'
>
>
Actually, that is very telling...  Did you restart python after editing the
.py file?  Python will only load a source file once in a session (unless
explicitly forced to do a reload, but that is not intended for newbies).
So, any changes to any source .py file will not take effect until you
restart your python session.  This is different from other languages like
Matlab.

Ben Root

P.S. - The way I am able to deduce this is that when an exception occurs,
the "compiled" code will tell python which lines it came from in the
original source file so that python can display the traceback.  If you edit
the source file to add a line before the line that triggers a traceback, it
can look like the wrong line is triggering the error because the compiled
code doesn't know that its source has been updated.
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to