RSS feed
[root]
/
c09
/
code
/
TI Pattern
/
software design
/
document
javaclass
login:
password:
title search:
Search this site
Enter your search terms
Web
www.carfield.com.hk
Submit search form
Prev
Next
Wed Dec 26 16:00:00 GMT 2001
MultipleJythons
//: c09:MultipleJythons.java // You can run multiple interpreters, each // with its own name space. import org.python.util.PythonInterpreter; import org.python.core.*; import com.bruceeckel.test.*; public class MultipleJythons extends UnitTest { PythonInterpreter interp1 = new PythonInterpreter(), interp2 = new PythonInterpreter(); public void test() throws PyException { interp1.set("a", new PyInteger(42)); interp2.set("a", new PyInteger(47)); interp1.exec("print a"); interp2.exec("print a"); PyObject x1 = interp1.get("a"); PyObject x2 = interp2.get("a"); System.out.println("a from interp1: " + x1); System.out.println("a from interp2: " + x2); } public static void main(String[] args) throws PyException { new MultipleJythons().test(); } } ///:~
(google search)
(amazon search)
1
2
3
second
download zip of files only
Prev
Next