From 52df356111a72868ebae1e766b8712a1b587ff1f Mon Sep 17 00:00:00 2001 From: Adam Long Date: Thu, 28 Jul 2016 19:27:33 +0000 Subject: [PATCH] removed useless comments --- ds.py | 11 ++++------- rpi.py | 6 +++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ds.py b/ds.py index d790e87..6792dfc 100644 --- a/ds.py +++ b/ds.py @@ -3,7 +3,7 @@ import pygame import sys host = "192.168.1.136" -port=5802 +port = 5802 screen = pygame.display.set_mode((640,480),0) @@ -11,9 +11,7 @@ while True: clientsocket=socket.socket(socket.AF_INET, socket.SOCK_STREAM) clientsocket.connect((host, port)) received = [] - # loop .recv, it returns empty string when done, then transmitted data is completely received while True: - #print("esperando receber dado") recvd_data = clientsocket.recv(230400) if not recvd_data: break @@ -22,12 +20,11 @@ while True: dataset = ''.join(received) print(len(dataset)) - image = pygame.image.fromstring(dataset,(640,480),"RGB") # convert received image from string - screen.blit(image,(0,0)) # "show image" on the screen + image = pygame.image.fromstring(dataset,(640,480),"RGB") + screen.blit(image,(0,0)) pygame.display.update() - # check for quit events for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() - sys.exit() \ No newline at end of file + sys.exit() diff --git a/rpi.py b/rpi.py index 6173ffc..8388b2e 100644 --- a/rpi.py +++ b/rpi.py @@ -20,12 +20,12 @@ floorCam.start() while True: connection, address = serversocket.accept() - goalImage = goalCam.get_image() # capture image - floorImage = floorCam.get_image() # capture image + goalImage = goalCam.get_image() + floorImage = floorCam.get_image() merged = pygame.Surface([640,480]) merged.blit(goalImage,(0,0)) merged.blit(floorImage,(320,0)) - data = pygame.image.tostring(merged,"RGB") # convert captured image to string, use RGB color scheme + data = pygame.image.tostring(merged,"RGB") try: connection.sendall(data) except socket.error: