Advertisements

Dj Gilcrease schrieb:
> Say I have an application that lives in /usr/local/myapp it comes with
> some default plugins that live in /usr/local/myapp/plugins and I allow
> users to have plugins that would live in ~/myapp/plugins
>
> Is there a way to map ~/myapp to a user package so I could do "from
> user.plugins import *" or better yet map it to myapp.user?

No. You can execfile things in there, or you can add ~/myapp to the
sys.path and then import things in there. And you can create aliases for
those of course.

Alternatively, namespace-packages and virtualenvs might be a solution,
but not exactly straight-forward as well.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!