Compare commits

..

5 Commits

Author SHA1 Message Date
b69d6032b2 close at the end 2021-04-25 13:11:10 +02:00
bc9d2493a9 dict for 2021-04-25 13:08:51 +02:00
b0d2c66f09 ups 2021-04-25 13:07:10 +02:00
77490bae60 print results 2021-04-25 13:03:26 +02:00
625b7926eb better processing 2021-04-25 13:02:15 +02:00
3 changed files with 28 additions and 3 deletions

View File

@ -18,4 +18,13 @@ try:
consumer.close()
except KeyboardInterrupt:
consumer.close()
print(DATETIMES)
dt = {}
for datetime in DATETIMES:
dts = datetime.strftime("%m/%d/%Y, %H:%M:%S")
if dts not in dt:
dt[dts] = 1
else:
dt[dts] +=1
for key in dt:
print(key,",",dt[key])
consumer.close()

View File

@ -23,5 +23,13 @@ try:
channel.basic_consume(queue=queue_name, on_message_callback=callback, auto_ack=True)
channel.start_consuming()
except KeyboardInterrupt:
dt = {}
for datetime in DATETIMES:
dts = datetime.strftime("%m/%d/%Y, %H:%M:%S")
if dts not in dt:
dt[dts] = 1
else:
dt[dts] +=1
for key in dt:
print(key,",",dt[key])
connection.close()
print(DATETIMES)

View File

@ -17,5 +17,13 @@ try:
m = socket.recv_string()
DATETIMES.append(datetime.now())
except KeyboardInterrupt:
dt = {}
for datetime in DATETIMES:
dts = datetime.strftime("%m/%d/%Y, %H:%M:%S")
if dts not in dt:
dt[dts] = 1
else:
dt[dts] +=1
for key in dt:
print(key,",",dt[key])
socket.close()
print(DATETIMES)