Skip to content

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

License

Notifications You must be signed in to change notification settings

filipi/phpPythonPipe

Repository files navigation

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();
?>

About

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

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published