-4

I have this simple python code:

import os
#os.system ("bash -c 'ls /home/'")
script = "ls /home/user/"
os.system(script)

How do I use PHP to display the output?

1 Answers1

0

Not with HTML, but using PHP first you can output to HTML from a python script using shell_exec e.g.

<?php $output = shell_exec("python scriptName.py");
echo '<p>'.$output.'<p>'; ?>
elmarko
  • 813
  • 7
  • 17