You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
775 B
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Java 对外部的调用
## Java 中调用 Python动态传入参数
### 1 使用场景
- 在定时任务调度场景中会用到,需要定时去触发某个作业作业需要支撑业务线丰富的场景可以是接口调用、Shell 脚本执行、推送 MQ、Python 脚本执行等。
- Python 拥有非常丰富的第三方类库,有些功能用 Python 来实现的话,可能仅仅需要引入一下包,几行代码就搞定了。
### 2 官网地址
- 官网地址https://www.jython.org/
- Github 地址https://github.com/jython/jython
### 3 准备步骤
- 导入依赖
- 需要在你的机器上先安装好 Python 环境
- 新建单元测试,通过 Java 代码直接执行 Python 语句:
### 4. 代码地址
- test目录下 (com.baiye.demo1)