jpype package, could be path problem

kelemen.viktor kelemen at inf.elte.hu
Wed Sep 20 07:00:06 EDT 2006


Hi

thanks for your suggestions

ive modified the sample code

"
import jpype
from jpype import *

jpype.startJVM('/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386/client/libjvm.so','-ea')
java.lang.System.out.println("hello world")
shutdownJVM()
"

and its working. It seems to be quite strange.
What would be the difference between the two import?

Viktor


Rob Wolfe wrote:
> Consider this:
>
> # bad style (potential name clash)
> from jpype import *
> startJVM('/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386/client/libjvm.so','-ea')
>
> # that's better
> import jpype
> jpype.startJVM('/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386/client/libjvm.so','-ea')
>
> # for long names of modules
> import jpype as jp
> jp.startJVM('/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386/client/libjvm.so','-ea')
>
> And see this:
> http://docs.python.org/tut/node8.html
> 
> HTH,
> Rob




More information about the Python-list mailing list