importing scripts from another directory in Jython

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown importing scripts from another directory in Jython

by Nair, Mukesh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I am new to Jython and grinder. I am struggling to use a script login.py
which is written in another directoy in my main script PackTest.py.
If I copy the login.py to PackTest.py drictory my import works fine.
Otherwise it gives following error. Is there a way to do it? I've been
googling the whole day to do this :(

10/29/09 3:08:24 PM (agent): worker BOSWXL20006441-0 started
*sys-package-mgr*: can't create package cache dir,
'C:\grinder-3.2\lib\jython.jar\tmp\packages'
10/29/09 3:08:27 PM (process BOSWXL20006441-0): Error running worker
process (ImportError: no module named login
        File "c:\yantra\systest\src\scripts\pack\PackTest.py", line 9,
in ?)
10/29/09 3:08:27 PM (agent): finished

Thanks in advance
Mukesh

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: importing scripts from another directory in Jython

by Brian Dols :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Mukesh,
Sections 6.1.2 and 6.4 of this tutorial should help you:
http://docs.python.org/tutorial/modules.html

On Thu, Oct 29, 2009 at 03:30:32PM -0400, Nair, Mukesh wrote:

> Hi
>
> I am new to Jython and grinder. I am struggling to use a script login.py
> which is written in another directoy in my main script PackTest.py.
> If I copy the login.py to PackTest.py drictory my import works fine.
> Otherwise it gives following error. Is there a way to do it? I've been
> googling the whole day to do this :(
>
> 10/29/09 3:08:24 PM (agent): worker BOSWXL20006441-0 started
> *sys-package-mgr*: can't create package cache dir,
> 'C:\grinder-3.2\lib\jython.jar\tmp\packages'
> 10/29/09 3:08:27 PM (process BOSWXL20006441-0): Error running worker
> process (ImportError: no module named login
>         File "c:\yantra\systest\src\scripts\pack\PackTest.py", line 9,
> in ?)
> 10/29/09 3:08:27 PM (agent): finished
>
> Thanks in advance
> Mukesh
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> grinder-use mailing list
> grinder-use@...
> https://lists.sourceforge.net/lists/listinfo/grinder-use

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use