众所周知,Java开发项目绝对很顶,而作为脚本语言的python在爬虫等数据处理方面有得天独厚的优势。
那么充分利用二者优势,势必提高整个项目效率。
以IDEA为背景,用SpringBoot整合二者。
1. 去官网下载python3
2. 导入依赖
<dependency>
<groupId>org.python</groupId>
<artifactId>jython</artifactId>
<version>2.7.2</version>
</dependency>
3. 测试
@Test
void contextLoads() {
PyString strJson= Py.newStringOrUnicode("hello");
System.out.println(strJson);
PyInteger a=Py.newInteger(1);
System.out.println(a);
}
运行结果:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)