There are many ways to solve this problem, just a few off the top of my head:
Create a queue, where your PHP script deposits work items that your Python script reads, performs the work, and then updates a status table.
Create an API for your Python script which your PHP script (or any other script) can consume.
Dump your input into a directory which the Python script watches for data, and then writes the result to the file system where you can read and display it using PHP.
There are more scenarios you can use but as you haven't provided any information about the system it is difficult to recommend a solution. For example, do you need intermittent updates on the status of the work being done? Is the job something that can be queued or will you block your PHP application? Are the two scripts on the same system or are they distributed? How are you communicating between the two scripts?
The "best" can only be provided if you give us your system constraints.