+ 1

Can I link between python file and php script in one project ??

I want to use python file to read data from excel sheet and store into database and then show the data into web page using php.

9th Feb 2020, 8:59 AM
Ravi Undaviya
Ravi Undaviya - avatar
2 Respuestas
+ 3
i think its possible using popen ( https://www.php.net/manual/en/function.popen.php ), but i never actually tried it with python.
9th Feb 2020, 9:10 AM
Taste
Taste - avatar
+ 2
there are many scenarios to cover this. in addition to the above post. you can use exec() to execute a python script, how that script returns data is where you have to decide. + could write to a file and then parse it with php. + returns an array +.... try this on sololearn PHP code playground. <?php $test = exec("ls -l") ; echo $test ?> it would execute ls command and return the result to $test. ps:you can use python for backend.
9th Feb 2020, 9:27 AM
Bahhaⵣ
Bahhaⵣ - avatar