gapan / xdgmenumaker

A command line tool that generates XDG menus for several window managers
GNU General Public License v3.0
56 stars 15 forks source link

not enough values to unpack (expected 3, got 1) #16

Closed wongpenghong closed 5 years ago

wongpenghong commented 5 years ago

this is my code : URLCounts = {}

with open(logPath, "r") as f: for line in (l.rstrip() for l in f): match= format_pat.match(line) if match: access = match.groupdict() request = access['request'] (action, URL, protocol) = request.split() if URL in URLCounts: URLCounts[URL] = URLCounts[URL] + 1 else: URLCounts[URL] = 1

results = sorted(URLCounts, key=lambda i: int(URLCounts[i]), reverse=True)

for result in results[:20]: print(result + ": " + str(URLCounts[result]))

this is error :

ValueError Traceback (most recent call last)

in () 7 access = match.groupdict() 8 request = access['request'] ----> 9 (action, URL, protocol) = request.split() 10 if URL in URLCounts: 11 URLCounts[URL] = URLCounts[URL] + 1 ValueError: not enough values to unpack (expected 3, got 1)
gapan commented 5 years ago

I don't understand what this has to do with xdgmenumaker.