dongtie0929
dongtie0929
2017-11-16 22:59

如何在PHP下调用python脚本文件?

已采纳

I have two files in the same directory:

index.php
excel.py

I tried to call excel.py in file index.php like:

$buff = system('python excel.py ' . $handle->file_dst_pathname, $retval);

I use Windows 10

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dqp99585 dqp99585 4年前

    Try it like this,

    exec("C:\Python27\python.exe C:\dir...\file.py");
    

    The problem is you must call C:\Python27\python.exe Python exe file before python file.

    点赞 评论 复制链接分享

相关推荐