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 *

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

from matplotlib.pyplot  import *
if __name__ == "__main__":

Then if imported from another module, this crashes my program when run non-
interactively.

I didn't expect merely importing matplotlib to try to open the display.  I'm 
not changing backends in my rc file, because there are plenty of times when 
I want matplotlib to use my favorite gui.


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