Created
June 23, 2013 16:47
-
-
Save schneider42/5845667 to your computer and use it in GitHub Desktop.
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 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