No this should work. I do it all the time. There must a bypo somewhere

On Oct 16, 2:15 pm, leone <[email protected]> wrote:
> Yes I know.
> I use it to import single module.
> I receive errors when I try to
> import applications.myapp.modules.widgets.pippo as pippo
> where widgets is a directory ( with __init__.py) located in myapp/
> modules
> and contain pippo.py.
> I can import only modules as files under /modules?
>
> leone
>
> On 16 Ott, 15:37, mdipierro <[email protected]> wrote:
>
> > If you module is a file
>
> >    applications/mypp/modules/mymodule.py
>
> > then you should be able to import is with
>
> >    from applications.myapp.modules.mymodule import *
>
> > or
>
> >    exec('from applications.%s.modules.mymodule import *' %
> > request.application)
>
> > It is important that the module itself imports other files from the
> > same module using relative paths and not absolute paths.
>
> > Massimo
>
> > On Oct 16, 5:37 am, leone <[email protected]> wrote:
>
> > > I try to import a module of  py files (initialized by __init__.py) and
> > > that is set in applications/myapp/modules folder, but I receive errors
> > > about import.
>
> > > from applications/myapp/modules/mymodule import *     fails!
>
> > > Is it possible this approach or I have to put py files directly under /
> > > modules directory?
> > > If not, why?
> > > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to