Running python script from php

前端 未结 1 526
孤独总比滥情好
孤独总比滥情好 2021-01-14 21:22

I am trying to run a python script from php.

exec(\"../cgi-bin/form.py\", $output);
var_dump($output);

I\'m certain the path is correct, an

1条回答
  •  孤街浪徒
    2021-01-14 22:04

    You're literally just typing in the location of the file. You need to tell exec to execute python with that script.

    exec("python ../cgi-bin/form.py", $output);
    

    0 讨论(0)
提交回复
热议问题