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);
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。