python调用jar包
import os
from jpype import *
jarpath = os.path.join(os.path.abspath('.'), 'path/xx.jar')
startJVM(getDefaultJVMPath(), "-Djava.class.path=%s" % jarpath)
FORMatScript = JClass('com.TestMain')
t = FormatScript()url = ["Http://www.test.com/8556.htm"]
t.test(url)content = t.content
java.lang.System.out.println(content)
shutdownJVM()
相关文章