0

I have 5 python programs in my raspberry pi. I have installed LAMP Server in raspberry pi.

Now I would like to make a web page and execute those program.

Is there any way to execute them and display the output on the web browser?

Nikolay Kostov
  • 16,433
  • 23
  • 85
  • 123
  • 1
    Yup, you can look into using [webpy](http://webpy.org/install) to serve up input from your python files on a HTTP server then access that using a web browser. – Huey Apr 14 '15 at 12:58

1 Answers1

1

You can execute like so:

$command = escapeshellcmd('/usr/custom/test.py');
$output = shell_exec($command);
echo $output;

There is further information Running a python script from PHP

You can then make a simple page with buttons that executes the relevant scripts.

Community
  • 1
  • 1
The Humble Rat
  • 4,586
  • 6
  • 39
  • 73