How to dynamically/runtime load the module from python .egg and instantiate class? -


i have python package created using pydev in eclipse. instantiate class dynamically, provided module name string , using locate function pydoc, loaded module , instantiated class.now, want create python egg package , dynamically import module egg , instantiate class. how can extract module , instantiate class given have python egg in url/path.

below example of instantiating class providing module/class name string

from pydoc import locate my_class = locate('domain.module.submodule.myclass') my_instance = my_class() 

now instead of module name string, want give path/url of python egg contains module , instantiate class.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -