Defer, ensure library is loaded
Jason
jasonhihn at gmail.com
Tue Feb 13 11:02:38 EST 2018
I have a variety of scripts that import some large libraries, and rather than create a million little scripts with specific imports, I'd like to so something like
psycopg2 = ensure_imported (psycopg2)
This way, regardless of invocation I can know psycopg2 is loaded, if it hasn't already been loaded. If I just do a normal import 95% of the time I'll be waiting time with a meaningless import.
Can I do that somehow?
More information about the Python-list
mailing list