How to sort IP addresses stored in dictionary in Python?

后端 未结 8 1693
隐瞒了意图╮
隐瞒了意图╮ 2020-11-29 08:32

I have a piece of code that looks like this:

ipCount = defaultdict(int)

for logLine in logLines:
    date, serverIp, clientIp = logLine.split(\" \")
    ipC         


        
8条回答
  •  既然无缘
    2020-11-29 09:06

    I think this will help you: PEP265 (sorting dictionieries by value). Just extend the sorted function.

提交回复
热议问题