From a3aa74b3b9c40569dc778857cf4d02628db22e70 Mon Sep 17 00:00:00 2001 From: tonton Th Date: Tue, 14 Apr 2020 11:08:52 +0200 Subject: [PATCH] converting to python3 --- tools/relay.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/relay.py b/tools/relay.py index 1d9c341..c745236 100755 --- a/tools/relay.py +++ b/tools/relay.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import socket, sys, getopt @@ -19,11 +19,11 @@ arguments = sys.argv[1:] opts, args = getopt.getopt(arguments, options) for o, a in opts: - print ' ', o, ' --> ', a + print (' ', o, ' --> ', a) if "-v" == o: verbose += 1 elif "-p" == o: rx_port = int(a) -print "listening port : ", rx_port +print ("listening port : ", rx_port) # --- @@ -34,7 +34,7 @@ for ligne in open("destinations.liste"): if p: cibles.append((a, int(p))) for cible in cibles: - print " -> ", cible + print (" -> ", cible) # point d'entree, d'ecoute @@ -49,7 +49,7 @@ sock_tx = socket.socket(socket.AF_INET, # Internet while True: data, addr = sock_rx.recvfrom(1024) # buffer size is 1024 bytes if verbose: - print "got:", addr, " ", len(data) + print ("got:", addr, " ", len(data)) for cible in cibles: # print cible sock_tx.sendto(data, cible)