0x00 前言

由于对python脚本的依赖,所以我们可能需要在框架里进行使用python代码

0x01 start

1. 首先建一个文件夹用来存放python脚本

ThinkPHP如何调用python脚本

2.python脚本的内容

print "123"
print "4"
print "5"

3.php代码调用

			header("content-type:text/html;charset=utf-8");
            $order="python ".getcwd()."\\python\a.py";
            $data = shell_exec($order); 

4. 执行效果

ThinkPHP如何调用python脚本

相关文章:

  • 2022-03-11
  • 2021-11-26
  • 2022-02-06
  • 2022-03-09
  • 2021-11-01
  • 2021-09-01
  • 2022-12-23
  • 2021-12-30
猜你喜欢
  • 2022-02-22
  • 2022-12-23
  • 2021-05-24
  • 2023-02-14
  • 2021-09-04
  • 2021-04-14
  • 2021-12-03
相关资源
相似解决方案