This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import json | |
stdoutdata = subprocess.getoutput("speedtest -f json") | |
#print(stdoutdata.split()[0]) | |
results = json.loads(stdoutdata) | |
for key in results: | |
download = results["download"]["bandwidth"] | |
upload = results["upload"]["bandwidth"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
import ctypes | |
from PIL import Image | |
from PIL import ImageFont | |
from PIL import ImageDraw | |
from win10toast import ToastNotifier | |
url = "https://api.nasa.gov/planetary/apod?api_key=" | |
os.environ['NO_PROXY'] = 'nasa.gov' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
import ctypes | |
from win10toast import ToastNotifier | |
url = "https://api.nasa.gov/planetary/apod?api_key=" | |
os.environ['NO_PROXY'] = 'nasa.gov' | |
r = requests.get(url) | |
toaster = ToastNotifier() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
import ctypes | |
from win10toast import ToastNotifier | |
url = "https://api.nasa.gov/planetary/apod?api_key=" | |
os.environ['NO_PROXY'] = 'nasa.gov' | |
r = requests.get(url) | |
toaster = ToastNotifier() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########### Python 3.2 ############# | |
import http.client, urllib.request, urllib.parse, urllib.error, base64, json, jsonify | |
import sys, getopt | |
def main(argv): | |
query = '' | |
offset = 0 | |
limit = 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time | |
import numpy as np | |
import subprocess | |
from envirophat import weather, leds, light | |
import scrollphathd as sphd | |
from scrollphathd.fonts import font3x5 | |
sphd.clear() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import sys, getopt | |
import tikteck | |
def connecttoBulb(b): | |
bulb = tikteck.tikteck(b, "Smart Light", "[PASSWORD]") | |
bulb.connect() | |
return bulb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
response = requests.get('http://www.tesco.com/groceries/en-GB/search?query=blueberry') | |
soup = BeautifulSoup(response.text, 'html.parser') | |
for item in soup.select('.product-list--list-item'): | |
try: | |
product = item.find(class_='product-image').get('alt', '') | |
value = item.find(class_='value').get_text() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time | |
import unicornhat as unicorn | |
import urllib | |
unicorn.set_layout(unicorn.AUTO) | |
unicorn.rotation(0) | |
unicorn.brightness(0.5) | |
width,height=unicorn.get_shape() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
from envirophat import weather | |
import time, os, sys, urllib, urllib2 | |
THINGSPEAKKEY = 'ENTERYOURAPIKEY' | |
THINGSPEAKURL = 'https://api.thingspeak.com/update' | |
def sendData(url, key, field1, field2, temp, pres): | |
values ={'api_key' : key, 'field1' : temp, 'field2' : pres} |