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!

  • No ! User how to send data to script ? Can't talk with output ! `ba10e.py` content ? A tricks : `what is sys.argv ?` – dsgdfg Jul 14 '16 at 06:55
  • @dsgdfg let's explain me with link or tech by you – Rofi Fathurrohman Jul 14 '16 at 07:33
  • `shell_exec ("sudo python /python/ba10e.py -q 'I ask you a question why don't give any answer ?' >/dev/null 2>&1 &");` Grab `-q`(mean query) and `'I ask you a question why don't give any answer ?'`(mean details of query) with `sys.argv` not clear comment ? Check this : http://stackoverflow.com/questions/4117530/sys-argv1-meaning-in-script – dsgdfg Jul 14 '16 at 08:47

0 Answers0