0

I want to sending data from php frontend to python. I have the following php code.

shell_exec ("sudo python /python/ba10e.py >/dev/null 2>&1 &");

With the above code, sending data to python works, However when python program asks for a choice mentioned below:

The money that you input is incorrect, you want to continue?

There are two choices, "Y" and "N".

How should implement the part of sending value to Python program when "Y" is entered. Is it possible to do so?

Thanks and regards!

1 Answer 1

1

Since you are looking for communication rather than just script invocation, I think you should look at inter-process communication methods, such as sockets. You can find plenty of resources online on how to do this, here's one from the python docs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.