Late binding of libraries? #19962
Unanswered
JTGartner
asked this question in
Core Development
Replies: 1 comment 4 replies
|
For dynamic import in Python use the built-in function, import(libNameStr) |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I’m a retired programmer trying to learn Micropython. I’m playing with a Micropython program that will display all the methods in a class. I Invision the program asking the user for the library name, the app would then display all the classes in that library. The program would then ask the class name, and the program would then respond with all that class’s methods. Rather than importing all possible libraries, I'd like to import the library only if needed, that way if a new library is published, the program would not have to rewritten.
My question is, does Micropython support late binding of libraries? I’d like to do something like:
When I try this, I get an Import error:
ImportError: no module named 'libNameStr'Is this possible?
Thanks,
Jack
All reactions