From 21b1c126cb93dd3dad2f24fdab97b06c78eab7b0 Mon Sep 17 00:00:00 2001 From: Alasdair Colley Date: Fri, 20 Sep 2013 15:04:44 +0100 Subject: pythonifying some stuff --- wikiquery | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/wikiquery b/wikiquery index d5806ea..e9661cc 100755 --- a/wikiquery +++ b/wikiquery @@ -12,11 +12,8 @@ version = "0.1.5" def stringify(o): if isinstance(o, list): output = [] - i = 0 - for item in o: - item = `i` + ": " + item - output.append(item.encode("utf-8", "replace")) - i = i + 1 + for i, item in enumerate(o, 1): + output.append("%s: %s" % (i, item.encode("utf-8", "replace"))) return ' %s' % ', '.join(output) else: -- cgit v1.2.3