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?

Andrew Fount
  • 2,313
  • 2
  • 29
  • 62

1 Answers1

2

By using the popen() function:

$result = popen('python yourscript.py ' . $args, 'r');
Konstantin Yovkov
  • 60,548
  • 8
  • 97
  • 143