我们如何在烧瓶项目中使用php和python

时间:2017-09-20 09:38:03

标签: php python webpage-screenshot

我正在研究一个烧瓶项目,其中我使用PHP来获取屏幕截图。我们如何在烧瓶项目中使用php和python。

2 个答案:

答案 0 :(得分:0)

你可以像

一样运行php脚本
import subprocess

# if the script don't need output.
subprocess.call("php /path/to/your/script.php")

# if you want output
proc = subprocess.Popen("php /path/to/your/script.php", shell=True, stdout=subprocess.PIPE)
script_response = proc.stdout.read()

参考:Use php script in python

答案 1 :(得分:0)

或在php脚本中使用python:

<?php

exec(“python my_pyton.py”); ?&GT;