Skip to content

Instantly share code, notes, and snippets.

@schneider42
Created June 23, 2013 16:47
Show Gist options
  • Save schneider42/5845667 to your computer and use it in GitHub Desktop.
Save schneider42/5845667 to your computer and use it in GitHub Desktop.
import socket
import sys
from PIL import Image
image = Image.open(sys.argv[1])
UDPHOST = "2001:7f0:3003:cafe:222:f9ff:fe01:c65"
UDPPORT = 2323
sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
def send(buffer):
sock.sendto(buffer, (UDPHOST, UDPPORT))
def sendImage(image):
image = image.convert('1')
cb = image.tobytes()
send(cb)
sendImage(image)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment