我想从codeigniter控制器发送一个数组,以便在python文件中接收进一步的执行。我已将数组传递给python文件,但无法在python文件中接收数组
编码点火器控制器
class Aanalysis extends CI_Controller
{
public function __construct() {
parent::__construct();
}
public function index()
{
$postData = array(
'hashtag' => $this->input->post('hashtag'),
'nooftweets' => $this->input->post('nooftweets')
);
$output = shell_exec("python main.py" $postData);
}
}
您需要给出python文件/脚本的完整路径。 比如,
system('/full/path/to/your_python_file.py');
如果python文件存在于codeigniter项目所在的apache目录中,则不需要给出完整路径相关问题 更多 >
编程相关推荐