Re: [Tutor] loading modules only when needed and PEP 008

2008-03-19 Thread Eric Walstad
Hey Timmie, Tim Michelsen wrote: >> When I do this sort of thing I like >> to move my imports into my functions/methods. > Would this then be compliant with the style recommendations? Hm, I'm not sure. I guess that if you consider that somewhere near the top of the style guide it says something a

Re: [Tutor] loading modules only when needed and PEP 008

2008-03-19 Thread Tim Michelsen
> When I do this sort of thing I like > to move my imports into my functions/methods. Would this then be compliant with the style recommendations? > The 'main' code then > conditionally calls the function/method. All the code in the > function safely assumes that the import has been done but co

Re: [Tutor] loading modules only when needed and PEP 008

2008-03-19 Thread Eric Walstad
Hi Tim, Tim Michelsen wrote: > Hello fellow Pythonistas, > I have a question concerning import statements. ... > it takes a lot > of time for a TKinter-GUI to start up. And this start-up time is even > longer when matplotlib is imported > a optimized version would be: > import sys > > plot_

[Tutor] loading modules only when needed and PEP 008

2008-03-19 Thread Tim Michelsen
Hello fellow Pythonistas, I have a question concerning import statements. My code uses matplotlib to plot the results of my calculations. Since I want to make this plotting functionality a optional feature I would like to import matplotlib only when needed because it takes a lot of time for a T