I'm working on a python plugin & it needs to retrive some data from php script, As I tried below I can retrive php output as shell command,
But I need to call start() function from my python script by passing values as start(10,15)
Is there a possible way to call start() php function with parameters from python script ?
PHP Script:
<?php
function start($height, $width) {
return $height*$width;
}
echo start(10,15); // #1
?>
Python Script:
import subprocess
result = subprocess.run(
['php', './check1.php'], # program and arguments
stdout=subprocess.PIPE, # capture stdout
check=True # raise exception if program fails
)
print(result.stdout) # result.stdout contains a byte-string