0

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?

1

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 help – daQuincy Oct 2 '16 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 Oct 2 '16 at 13:03
0

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.

https://github.com/omkarjc27/data-transfer-portal

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.