0

What is the fastest way to execute Python from PHP assuming that I need to pass variables to Python script and get result from it?

Paul R
  • 2,631
  • 3
  • 38
  • 72

1 Answers1

2

By using the popen() function:

$result = popen('python yourscript.py ' . $args, 'r');
Konstantin Yovkov
  • 62,134
  • 8
  • 100
  • 147