Witam,
mam taki kod do pobierania wartosci z czujnika a pozniej wysylam go postem na serwer.
(temperature,pressure)=readBmp180()
print("Temperature : {0} C".format(temperature))
print("Pressure : {0} mbar".format(pressure))
data = {
"cisnienie": pressure,
"temperatura" : temperature
}
req = urllib2.Request('serwer')
req.add_header('Content-Type', 'application/json')
response = urllib2.urlopen(req, json.dumps(data))
Ale mam jakis problem ze zmienna przechowujaca cisnienie i temperature nie jest dostepna wewnatrz
data= {}
Jak to naprawic?