0

Below is my code in Python. My lecturer requested me is that possible to send the fanspeed.output['fan'] to PHP. For example, I created a webpage on xampp then I need to send the output of the python to the webpage which will display the output on the webpage. I searched online and I could not find a working way to solve it. Can anyone help, please?

temp = int(input("temp="))
hum = int(input("hum="))
fanspeed.input['temperature'] = temp
fanspeed.input['humidify'] = hum
fanspeed.compute()
fanspeed.output['fan']
fan.view(sim=fanspeed)
print("Fan speed =",fanspeed.output['fan'])
1
  • That's funny, I searched your question title in Google and got 10.8 million hits; 38000 of them from this site... Commented May 30, 2021 at 18:32

1 Answer 1

0

The easiest way is to call the python script via a shell_exec.

Something like this

<?php
echo shell_exec("python /path/to/your/python/script.py");
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.