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:
dts = datetime.strftime("%m/%d/%Y, %H:%M:%S")
if dts not in dt:
dt[strftime("%m/%d/%Y, %H:%M:%S")] = 1
dt[dts] = 1
else:
dt[strftime("%m/%d/%Y, %H:%M:%S")] +=1
for key, value in dt:
print(key,",",value)
dt[dts] +=1
for key in dt:
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.start_consuming()
except KeyboardInterrupt:
connection.close()
dt = {}
for datetime in DATETIMES:
dts = datetime.strftime("%m/%d/%Y, %H:%M:%S")
if dts not in dt:
dt[strftime("%m/%d/%Y, %H:%M:%S")] = 1
dt[dts] = 1
else:
dt[strftime("%m/%d/%Y, %H:%M:%S")] +=1
for key, value in dt:
print(key,",",value)
dt[dts] +=1
for key in dt:
print(key,",",dt[key])
connection.close()

View File

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