You should be able to do this as long as Y is in the same folder (modules/) as X. The current folder is always searched before the pythonpath.
On Aug 12, 2:40 pm, Ahmed Soliman <ah...@farghal.com> wrote: > Another problem is that I cannot *easily* import other modules from my > modules in modules/ :) > > this means that if I have module X in modules/ and module Y > I cannot do this while in X > import Y > > because the cwd is web2py/ so, I have to import by the application > name again, and as "request" is not defined there I have no clue > except including the application name in the import which limits my > deployment options, do we have a solution to this? > > I'm planning on creating a large web application with web2py and I'm > doing extensive playing with it and that include reading alot in the > source code to be sure that it's the right tool for me, so, for a > large project modularization is quite important and if I couldn't > modularize my project into modules and create a suitable directory > structure in modules/ that allows me to organize my work, then it > might be a serious problem because I'll end up writing everything in > the wrong place. > > Ahmed > > On Aug 12, 9:22 pm, Ahmed Soliman <ah...@farghal.com> wrote: > > > On Aug 12, 5:14 pm, DenesL <denes1...@yahoo.ca> wrote: > > > > To avoid restarting web2py after making changes use: > > > > exec('from applications.%s.modules.yourmodule import X' > > > %request.application) > > > reload(X) # remove for production > > > > Denes. > > > This doesn't work, did you try that? the reason is that X is probably > > a class and you cannot reload a class, you need a module object there. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---