On Thu, Jul 8, 2010 at 9:53 AM, Neal Becker <ndbeck...@gmail.com> wrote:
> Use case is I have a module that does digital design.  If run as main, it
> has a little test that does a plot.  The plot is supposed to use a gui and
> display.
>
> But if not run as main, there is no plot, and maybe no display.
>
> I had:
>
> if __name__ == "__main__":
>  from matplotlib.pyplot  import *

This is the right way.

> but this gives a warning about import * not at module level, so I changed to

Not to be overly blunt, but the way to solve this warning is to use:

import matplotlib.pyplot as plt

not move the import and complain about matplotlib's import behavior.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to