Skip to content

Instantly share code, notes, and snippets.

from phue import Bridge
b = Bridge('YOUR HUE BRIDGE IP')
b.connect()
# Import some funtions from TkInter
from tkinter import *
import tkinter.font
import tkinter.ttk
# Import some functions from Pillow
from PIL import ImageTk, Image
# Import the PyQRCode library
import pyqrcode
@huggre
huggre / car-iota-p1.py
Last active March 17, 2020 14:15
Python script for the Car-IOTA tutorial part 1
# Imports some required PyOTA libraries
import iota
from iota import Address
# Imports some libraries required by OpenALPR communication
import requests
import base64
import json
# Imports the CSV library used for DB comm.
@huggre
huggre / pay_the_light_hue.py
Last active March 17, 2020 14:17
Python code for the Integrating physical devices with IOTA - Philips Hue edition tutorial
#!/usr/bin/python
# Imports some Python Date/Time functions
import time
import datetime
# Imports the phue library
from phue import Bridge
# Create a Hue Bridge object
@huggre
huggre / hex_convert.py
Last active March 17, 2020 14:18
Helper for converting an IOTA address to a C++ hex array
# Imports the textrwap library
from textwrap import wrap
# Replace with your own IOTA payment address
sample = 'NYZBHOVSMDWWABXSACAJTTWJOQRPVVAWLBSFQVSJSWWBJJLLSQKNZFC9XCRPQSVFQZPBJCJRANNPVMMEZQJRQSVVGZ'
# Create a list with 4 characters in each element
mylist = wrap(sample,4)
result = ''
#!/usr/bin/python
# Imports some Python Date/Time functions
import time
import datetime
# Import requests library
import requests
# Import json library
# import the necessary packages
from rvm_lib import ReverseVendingMachine
from imutils.video import VideoStream
import time
# Select web cam. or PiCam
vs = VideoStream(src=0).start()
# vs = VideoStream(usePiCamera=True).start()
print("[INFO] warming up camera...")
# import the necessary packages
from __future__ import print_function
from PIL import Image
from PIL import ImageTk
import tkinter as tki
from tkinter import scrolledtext
from pyzbar import pyzbar
import threading
import imutils
import cv2
7030019532240 10
7310070786937 25
@huggre
huggre / p2p_energy_trade.py
Last active July 24, 2020 10:00
Python code for the "Peer-to-peer energy trading with IOTA Part 1" tutorial
#!/usr/bin/env python
# Import INA219 library
from ina219 import INA219
from ina219 import DeviceRangeError
# Import time
from time import sleep
# Import PyOTA library