DEV Community

Cover image for How can i RUN the Jupyter and/or google collaboratory, based visualization codes into my PHP webpage
linkzola
linkzola

Posted on

How can i RUN the Jupyter and/or google collaboratory, based visualization codes into my PHP webpage

How can I effectively integrate a Jupyter-based network visualization code, written in Python, into my PHP-based webpage? I've attempted to execute the Python script using shell_exec in PHP, but I'm open to alternative solutions and ideas. The Python script generates a network visualization, and I want to display this visualization on my webpage. Are there recommended practices for achieving this integration while ensuring security and flexibility in the visualization output format?

$scriptPath = 'C:\..\pathway_ik.py';  // Replace with the full path to your Python script

//$command = escapeshellcmd("$pythonPath $scriptPath");

$command = escapeshellcmd("$scriptPath");
$output = shell_exec($command);

echo "Script Output:<br>";
echo $output;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more