Please see http://web2py.com/books/default/chapter/29/04/the-core#Accessing-the-API-from-Python-modules .
On Tuesday, January 21, 2014 7:14:05 PM UTC-5, aapaap wrote: > > thanks Anthony, > the import now works partially. > > The lib needs to know the database "db" is it possible to import that. > from db import db > doesn't work > > cheers, > Stef > > On 21-01-14 23:55, Anthony wrote: > > Filename = os.path.join ( 'applications', >> request.application,'static\images\pic_%s.png' % Edit_Select), 'wb') >> > > os.path.join(request.folder, 'static', 'images', 'pic_%s.png' % > Edit_Select) > > Q2: >> I made some libraries that I want to use more than one project. >> Now I stored these in >> ..controllers/my_support_libs.py >> > > Controllers are not Python modules and cannot be imported. If you need > to share a module, put it anywhere in the pythonpath and import from there. > You can put it in the /modules folder of a given app and import from other > apps via: > > import applications.myapp.modules.mymodule > > Anthony > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

