Usually you will need to specify the context, since only the context parent will be in your pythonpath

Copy this into ShowPath.py and run as a servlet:

from WebKit.Page import Page
import sys

class ShowPath(Page):
def writeContent(self):
self.write(sys.path)

It will show where a servlet will look for its modules.

-Aaron

Huy Do wrote:
Hi,

What is the correct/recommended way of importing modules if I have the
following context directory.

/context1/util
/context1/libs
/context1/apps

In my servlets, should import using

import context1.util.file

or

import util.file

I am thinking the latter, but am not so sure.

Many thanks

Huy



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to