3
3
35000sobak2020-07-07 10:59:32
PHP
35000sobak, 2020-07-07 10:59:32

How to pass arguments from php script to python and vice versa?

There is a php and python script. The php script is the main one and must pass an argument, for example, from some variable to the python script and from the python, respectively, receive the finished value and display it in the php script. How can this be done in an easier way?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
soremix, 2020-07-07
@35000sobak

Make a simple flask server. Through PHP, you make a GET to your endpoint, and process it there.
https://habr.com/ru/post/246699/

S
Sergey Gornostaev, 2020-07-07
@sergey-gornostaev

Raise each of them as a separate web application that calls each other. In such a scheme, it doesn’t matter at all what scripts are written on.

S
sl0, 2020-07-07
@sl0

Through the REST API. From php you make a request, you get a response from python.
But in general, I would think - is it not easier to do everything together in php or in python than to fence such gardens.

L
Lynatik001, 2020-07-07
@Lynatik001

Mmm maybe by het request?)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question