发布网友 发布时间:2022-04-26 15:27
共1个回答
热心网友 时间:2022-04-07 09:53
py和php放在同一个目录下面some.py------------------------------------------#!/usr/bin/env python#-*- coding:utf-8 -*-import sysdef do_some(a):return "dosome:%s" % aif __name__ == '__main__':a = sys.argv[1]if a:T = do_some(a)print T-------------------------------------------t.php<?php$k = $_REQUEST['k'];if (!empty($k)){$k = trim($k);// $a = array();// exec('python ./some.py '.$k, $a);// echo $a[0];pa