Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import sys
  2. from time import sleep
  3. import urllib2
  4. import random
  5. API_KEY = #replace with your channel key
  6. a = 0
  7. baseURL = 'http://api.thingspeak.com/update?api_key=‘ + API_KEY + ‘&field1=‘
  8. a = random.randint(0,5)
  9. print a
  10. f = urllib2.urlopen(baseURL +str(a))
  11. f.read()
  12. f.close()
  13. sleep(5)
  14. print "Program has ended"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement