Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. (temperature,pressure)=readBmp180()
  2.   print("Temperature : {0} C".format(temperature))
  3.   print("Pressure    : {0} mbar".format(pressure))
  4.  
  5. data = {
  6.   "cisnienie": pressure,
  7.   "temperatura" : temperature
  8. }
  9.  
  10. req = urllib2.Request('serwer')
  11. req.add_header('Content-Type', 'application/json')
  12.  
  13. response = urllib2.urlopen(req, json.dumps(data))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement