$response = shell_exec("python3 script.py" . escapeshellarg(json_encode($data)));
/*
this code php send data to python
*/
<?php
$data = 'Hayder';
$output=shell_exec("python E:/test.py " .$data);
echo $output;
?>
\\\\\\\\\\\\\
/*
this code python to show data
*/
import sys
result = sys.argv[1]
print(result)