fix pytyhon 3.6 idiomatic syntax to make it more compatible

This commit is contained in:
mose 2019-09-09 12:02:55 +08:00
parent a5f0806437
commit d1153e68f1
2 changed files with 3 additions and 3 deletions

View file

@ -70,7 +70,7 @@ def main():
if uniqueUserGlobal[id] == None:
uniqueUserGlobal[id] = []
labels[id] = begin.strftime("%x")
print(f"\t{labels[id]}")
print("\t{0}".format(labels[id]))
resultMess = list(filter(filter_message, messages))
length = len(resultMess)

View file

@ -70,7 +70,7 @@ def main():
if uniqueUserGlobal[id] == None:
uniqueUserGlobal[id] = []
labels[id] = begin.strftime("%b %Y")
print(f"\t{labels[id]}")
print("\t{0}".format(labels[id]))
resultMess = list(filter(lambda mess: begin < datetime.strptime(mess["ts"], "%Y-%m-%dT%H:%M:%S.%fZ") < end, messages))
length = len(resultMess)