You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
Hi @rochacbruno, nice work exporting this code to a new library, it's really usefull :)
I've done done this kind of import in some projects, but using this approach:
importimportlibfoopath='src.apis.foo.Foo'module_name='.'.join(foopath.split('.')[:-1]) # to get src.apis.foofoo_module=importlib.import_module(module_name)
clazz_name=foopath.split('.')[-1] # to get FooFoo=getattr(module_name, clazz_name)
printFoo()
It's almost the same thing, but using importlib instead of import directly. Actually, importlib uses the import function as well. Anyway, just creating this issue to share some alternatives to the same goal.
Thank you!
The text was updated successfully, but these errors were encountered:
Hi @rochacbruno, nice work exporting this code to a new library, it's really usefull :)
I've done done this kind of import in some projects, but using this approach:
It's almost the same thing, but using importlib instead of import directly. Actually, importlib uses the import function as well. Anyway, just creating this issue to share some alternatives to the same goal.
Thank you!
The text was updated successfully, but these errors were encountered: