Robin, sorry, no modifying the path is not thread safe. one just need to use the full path
import applications.appname.modues.modulename as modulename Massimo On Jan 18, 5:26 pm, Robin B <[email protected]> wrote: > Use caution when modifying sys.path in web2py, since the path will be > modified for other apps too, so you could import 'comm' from another > app, or another app could start importing your modules accidentally. > > Massimo, could the sys.path be restored to a default on each request? > > Robin > > On Jan 18, 4:40 pm, "Phyo Arkar" <[email protected]> wrote: > > > Ok i got it now : > > > By Doing this. > > import sys,os > > path=os.path.join(request.folder,'modules') > > if not path in sys.path: sys.path.append(path) > > import comm > > > On Sun, Jan 18, 2009 at 10:35 PM, Phyo Arkar > > <[email protected]>wrote: > > > > hello massimo; > > > > i have problem importing modules defined in modules folder > > > > I got this error : > > > > Traceback (most recent call last): > > > File "/opt/web2py/gluon/restricted.py", line 62, in restricted > > > > exec ccode in environment > > > File "/opt/web2py/applications/ycamp2pweb/controllers/default.py", line > > > 3, in <module> > > > > from comm import communicator > > > ImportError: No module named comm > > > > i have this folder structure > > > > Under > > > application_name/modules > > > __init__.py > > > comm > > > __init__.py > > > communicator.py --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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 -~----------~----~----~----~------~----~------~--~---

