Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • I get this error: AttributeError: 'module' object has no attribute 'myfun' Commented Dec 6, 2016 at 22:09
  • I assume then that "myfun" is not declared in the module. I've tested the above locally and found it to work. Commented Dec 6, 2016 at 22:23
  • so iv found that if i import the function like this import mymodule.mymodule.run then i can use this approach. but not otherwise Commented Dec 6, 2016 at 22:24
  • @dopatraman, i don't think import mymodule.mymodule.run works if run is a function in mymodule, i think you need import mymodule.mymodule as mymodule Commented Dec 6, 2016 at 23:19
  • hm, i figured as much. what i need to do is dynamically import mymodule Commented Dec 7, 2016 at 18:42