I've been following this guide http://www.instructables.com/id/Control ... /?ALLSTEPS and everything works flawlessly. I want to edit some features of this project, using a Sense HAT instead of LEDs.
I wrote a python program to read temperature from the Sense HAT. Clicking a button in the app will run the python code. The questions is, how do I retrieve the temperature data and display it on the the web page or the android app?
2 Answers 2
try
$output = shell_exec('/usr/bin/python script.py');
i think so you can get the output of the script
-
I'm still new to Python, what do I need to write in the script to return the temperature reading? Thanks for your helpdaQuincy– daQuincy2016年10月02日 12:38:47 +00:00Commented Oct 2, 2016 at 12:38
-
@daQuincy Please note this is not a discussion forum where asking an indefinite series of questions is appropriate; you should take the tour to understand better how the site works. Anyway, it looks to me like that php command takes the output of a python script, so the python script should just print out whatever information it is you want.goldilocks– goldilocks2016年10月02日 13:03:42 +00:00Commented Oct 2, 2016 at 13:03
I had a similar problem so i decided to make this method this currently supports just php and python but Im coding it to support java an also javascript i will also try to see if i can do the same for c and c++
Check Out
DATA TRANSFER PORTAL (D.T.P.) (github)
Excerpt:
DTP is a multiprogramming , multipurpose method to conviniently transfer data between various programming languages
It requires no complex installation process.