Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import importlib
- map = {
- 'name1': ('package.module1', 'Class1'),
- 'name2': ('module2', 'Class2'),
- }
- def get_class(name):
- class_path_tuple = exchange_api_map[name.lower()]
- return getattr(importlib.import_module(class_path_tuple[0]), class_path_tuple[1])
Add Comment
Please, Sign In to add comment