Compare commits

...

3 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
3 changed files with 15 additions and 14 deletions

View File

@ -22,8 +22,9 @@ except KeyboardInterrupt:
for datetime in DATETIMES: for datetime in DATETIMES:
dts = datetime.strftime("%m/%d/%Y, %H:%M:%S") dts = datetime.strftime("%m/%d/%Y, %H:%M:%S")
if dts not in dt: if dts not in dt:
dt[strftime("%m/%d/%Y, %H:%M:%S")] = 1 dt[dts] = 1
else: else:
dt[strftime("%m/%d/%Y, %H:%M:%S")] +=1 dt[dts] +=1
for key, value in dt: for key in dt:
print(key,",",value) print(key,",",dt[key])
consumer.close()

View File

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

View File

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