1.准备工作 安装有python和php环境的电脑一台。
2.书写程序。
php程序如下
我们也可以将exec(\'python test.py\') 换成 system(\'python test.py\')
区别是 system 有返回结果,exec没有返回结果
ps: 后记,如果是python 中有中文字符串,在php程序中要做编码转换处理。
iconv(\'gbk\', \'utf-8\', $output);
1.准备工作 安装有python和php环境的电脑一台。
2.书写程序。
php程序如下
我们也可以将exec(\'python test.py\') 换成 system(\'python test.py\')
区别是 system 有返回结果,exec没有返回结果
ps: 后记,如果是python 中有中文字符串,在php程序中要做编码转换处理。
iconv(\'gbk\', \'utf-8\', $output);
相关文章: