zoukankan      html  css  js  c++  java
  • java exec python program

    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.

  • 相关阅读:
    大数据概述
    语法分析-代码
    语法分析-C语言程序
    Hadoop综合大作业
    hive基本操作与应用
    理解MapReduce计算构架
    熟悉HBase基本操作
    爬虫大作业
    熟悉常用的HDFS操作
    数据结构化与保存
  • 原文地址:https://www.cnblogs.com/xu-xiaofeng/p/10903131.html
Copyright © 2011-2022 走看看