First option: (Recommended) You can create the python side as an API endpoint and from the PHP server, you need to call the python API.
Second option: You can create the python side just like a normal webpage and whenever you call that page from PHP server you pass the params along with HTTP request, and after receiving data in python you print the data in JSON format.