Import if condition is correct

MindClass jonas.esp at googlemail.com
Sat Oct 28 06:41:39 EDT 2006


Georg Brandl wrote:
> MindClass wrote:
> > Is possible import a library according to a condition?
> >
> > if Foo == True:
> >     import bar
> >
>
> Why don't you try it?
>
I thinked that could be another way for import statement.

In that case I'll have to set a global variable before of the import
statements although I'd prefer not use them.




More information about the Python-list mailing list