Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 711 Bytes

README.md

File metadata and controls

27 lines (18 loc) · 711 Bytes

screenshot

phpPythonPipe

A simple way to execute python code from PHP without using temp files.

phpPythonPipe uses unix pipes to redirect the Python output to a PHP script.

An easy way to integrate Python scripts into PHP.

Usage:

<?php
require_once("class.phpPythonPipe.php");

$pythonCode  = "import sys\n";
$pythonCode .= "print(\"Hello\")\n";

$python = new phpPythonPipe();
$python->kernelPath = "~/anaconda3/bin/python";
$python->code = $pythonCode;
$python->exec();
$python->print();
?>