Reputation: 215049
I've got a package like this:
foo/
__init__.py
bar.py
baz.py
I'd like to have submodules' functions automatically available when I import foo
. So if bar.py
has def spam()
somewhere, I'd like to be able to call it directly like foo.spam()
. What would be the best way to achieve that?
Upvotes: 3
Views: 189