.php file code
<?php
$para1 = "one";
echo shell_exec("python C:/xampp/htdocs/python/test.py '$para1'");
?>
.py file code
#! C:\Users\mhammad\AppData\Local\Programs\Python\Python39\python.exe
print("Content-Type: text/html\n\r\n") #this code is for run .py file in xampp localserver.
import sys
print(sys.argv)
output of python file while running on xampp server in browser.
['C:/xampp/htdocs/python/test.py']
how do I get variable value from .php file to .py file.