Jython_Java工程调用jython

来源:互联网 发布:js控制keyframes 编辑:程序博客网 时间:2024/06/16 05:53
1. 创建一个java工程,在java工程中用python脚本执行unittest
2.  在java中引入的包如下:
package org.jython.book.util;
import org.python.core.PyObject;
import org.python.core.PyString;
import org.python.util.PythonInterpreter;
3. 步骤如下:
    a) In the Package Explorer (on the left), right click on your Java project and select Properties.
    b) In the treeview on the left, select Java Build Path.
    c) Select the Libraries tab.
    d) Select Add External JARs...
    e) Browse to your Jython installation (C:\jython2.5.2 for me), and select jython.jar. Click OK.
    f) Click OK
原创粉丝点击