Import if condition is correct

Georg Brandl g.brandl-nospam at gmx.net
Sat Oct 28 06:37:10 EDT 2006


MindClass wrote:
> Is possible import a library according to a condition?
> 
> if Foo = True:
>     import bar
> 

Why don't you try it?

(in the above code, not the import is the problem, but using the
assignment operator in an expression)

Georg



More information about the Python-list mailing list