博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
java exec python program
阅读量:4623 次
发布时间:2019-06-09

本文共 998 字,大约阅读时间需要 3 分钟。

 

I find three methods, the first is using jython, the module of jython can transform the type of data between Python and java,so you can define the java data structure execution with Python interpreter, besides,Java receive appropriate type of data from Python interperter. but this method drawback is can`t import the third part package in python interperter.

The second is using java command line util which can start a new process to execute python program, this method very convinient,but not safe enough,because the process can`t be control when it started. If you not care about the security problem, I strongly recommend this method.

The third is most safety and complicated,some blog even mention it,but I think neccessary to let you know. The answer is RestApi, using web frame like flask for python,then you can start a webservice based on SSL and HTTPS,when using java code call the python RestApi, the CA certification is required.

 

转载于:https://www.cnblogs.com/xu-xiaofeng/p/10903131.html

你可能感兴趣的文章
Git 对象 和checkout 和stash的笔记
查看>>
团队项目总结2-服务器通信模型和顺序图
查看>>
hdu 1085 Holding Bin-Laden Captive!
查看>>
[周记]8.7~8.16
查看>>
递归定义
查看>>
kindeditor 代码高亮设置
查看>>
图的邻接表存储
查看>>
2018 leetcode
查看>>
PHP中获取当前页面的完整URL
查看>>
所谓输入掩码技术,即只有数字键起作用
查看>>
Display对象,Displayable对象
查看>>
安装oracle11G,10G时都会出现:注册ocx时出现OLE初始化错误或ocx装载错误对话框
查看>>
生产环境下正则的应用实例(一)
查看>>
在CentOS7命令行模式下安装虚拟机
查看>>
Arduino可穿戴开发入门教程Arduino开发环境介绍
查看>>
Windows平台flex+gcc词法分析实验工具包
查看>>
3.Python基础 序列sequence
查看>>
Chapter 4 Syntax Analysis
查看>>
vi/vim使用
查看>>
讨论Spring整合Mybatis时一级缓存失效得问题
查看>>