From: Samuele P. <pe...@in...> - 2002-04-05 00:52:38
|
From: Mark Elston <m.e...@AD...> > Thanks, Paul. This seems to do the trick quite nicely. > > In a response to your post Samuele Pedroni wrote: > > >> To access python module in a directory "Lib" contained in file > >> JythonLib.jar used this syntax: > >> > >> "/path/JythonLib.jar!Lib" > >> > > > >with Jython 2.1 final that becomes simply > > > >"/path/JythonLib.jar/Lib" > > I tried this and couldn't import the modules. I do have the latest > Jython installed. He is right that it is in the Readme. However, > this talks about the sys.path variable, while I added the file to the > python.path variable. I don't know if that makes a difference or > not. In addition, this appears to be referring to how it is handled > from within a script, not from a Java program instantiating an > interpreter. Maybe that makes a difference. python.path ends up in sys.path, no special-casing, that's all about it. > Until I hear differently, I will continue to use the method you > provided. > Ok, I live inside some kind of reality distorsion field: C:\exp\z>jar tf z.zip Lib/ Lib/a.py Lib/a$py.class C:\exp\z>\usr\jython-2.1\jython -Dpython.path="z.zip/Lib" Jython 2.1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import a a >>> C:\exp\z>\usr\jython-2.1\jython -Dpython.path="z.zip!Lib" Jython 2.1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import a Traceback (innermost last): File "<console>", line 1, in ? ImportError: no module named a and <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jython/jython/org/python/core/S yspathArchive.java.diff?r1=1.1&r2=1.2> <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jython/jython/org/python/core/S yspathArchive.java?rev=1.2&content-type=text/vnd.viewcvs-markup> puzzled regards. |