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.

java exec python program的更多相关文章

  1. Runtime.getRuntime().exec()实现Java调用python程序

    使用Runtime.getRuntime().exec()来实现Java调用python,调用代码如下所示: import java.io.BufferedReader; import java.io ...

  2. Java调用Python脚本

    今天遇到Java调用一个Python脚本的问题,纠结了大半天,遇到各种问题.网上搜索的大部分都是用jython,但是我想要调用的python脚本里有import urllib,这个urllib也不是什 ...

  3. Java调用Python相关问题:指定python环境、传入参数、返回结果

    本篇文章涉及到的操作均在Windows系统下进行,Java调用python在原理上不难,但是可能在实际应用中会有各种各样的需求,网上其他的资料很不全,所以又总结了这篇文章,以供参考. 一.指定pyth ...

  4. windows文本转语音 通过java 调用python 生成exe可执行文件一条龙

    我已记不清 我失败过多少次 ,找过多少资料 ,但是功夫不负有心人 ,还是成功了. 所有资料和需要的语音模块的资料以放置在文章末尾, 有些是引用别人的博客的部分内容, 原文是在有道云笔记,所以没有图,请 ...

  5. windows 下用eclipse搭建java、python开发环境

    本人只针对小白!本文只针对小白!本文只针对小白! 最近闲来无事,加上之前虽没有做过eclipse上java.python的开发工作,但一直想尝试一下.于是边查找资料边试验,花了一天时间在自己的机器上用 ...

  6. paip.执行shell cmd 命令uapi java php python总结

    paip.执行shell cmd 命令uapi java php python总结 作者Attilax  艾龙,  EMAIL:1466519819@qq.com 来源:attilax的专栏 地址:h ...

  7. Java vs Python

    面试时常问到这两种语言的区别,在此总结一下. Referrence: Udemy:python-vs-java Generally, Python is much simpler to use, an ...

  8. Java 调用python说明文档

    Java 调用python说明文档 通过java调用python脚本主要如下三种方式: 1.直接执行python脚本: 2.执行python.py文件: 3.使用Runtime.getRuntime( ...

  9. java调用python程序以及向python程序传递参数

    在做项目的时候,经常会碰到这个问题,主要程序是用java写的,有些功能使用python写的,整个项目需要把java代码和python代码进行整合,在一个项目里面运行,这就涉及到java调用python ...

随机推荐

  1. light oj 1035 - Intelligent Factorial Factorization 素因子分解

    1035 - Intelligent Factorial Factorization Given an integer N, you have to prime factorize N! (facto ...

  2. IT运维大会精华回顾 等保2.0时代掌控万物互联

    10月24日,由<网络安全和信息化>杂志社.IT运维网联合主办的“2019(第十届)IT运维大会”在北京新世纪日航酒店成功举行. 随着大数据.云计算.物联网.互联网+等快速发展,IT系统架 ...

  3. C#设计模式学习笔记:(16)观察者模式

    本笔记摘抄自:https://www.cnblogs.com/PatrickLiu/p/7928521.html,记录一下学习过程以备后续查用. 一.引言 今天我们要讲行为型设计模式的第四个模式--观 ...

  4. Verilog HDL学习_1:分频器/PWM的实现

    (一)参考学习资料 (二)实际操作 1. 相关变量计算:   First Initial Second Initial Upper case H X ASCII (Dec) 72 88 Lengths ...

  5. StarUML之二、StarUML初识

    为什么用StarUML UML建模工具比较常见的PowerDesigner ROSE StarUML starUML-开源免费(1-2百M),PowerDesigner-精细和一体化(6-7百M),R ...

  6. k8s~部署EFK框架

    EFK,ELK都是目前最为流行的分布式日志框架,主要实现了日志的收集,存储,分析等,它可以与docker容器进行结合,来收集docker的控制台日志,就是stdout日志. elasticsearch ...

  7. vue 3.0 项目搭建移动端 (六) 命名路由同级控制

    const Tabbar = () => import('@/components/Tabbar'); export default [ { path: '/', name: 'home', c ...

  8. jQuery---小火箭返回顶部案例

    小火箭返回顶部案例 1. 滚动页面,当页面距离顶部超出1000px,显示小火箭. 封装在scroll函数里,当前页面距离顶部为$(window).scrollTop >=1000 小火箭显示和隐 ...

  9. HTML表格概念、语法、操作、案例

    创建两行三列表格 <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...

  10. 怎么解决Chrome浏览器“Failed to load resource: net::ERR_INSECURE_RESPONSE”错误?

    用科学方法安装的arcgisServer,需要修改系统时间,但是修改了系统时间,可能会出各种问题, office 不能正确验证,chrome 不能正常使用,访问网页, 如果直接输入本地地址进行访问的话 ...