Commit da510ba8 authored by 高雅喆's avatar 高雅喆

update Top features format %

parent 399e04ee
...@@ -26,7 +26,7 @@ def result2file(result_lst,fpath): ...@@ -26,7 +26,7 @@ def result2file(result_lst,fpath):
f.write(tplt.format("平台","answer_id","点击数","曝光数","点击率","answer链接")) f.write(tplt.format("平台","answer_id","点击数","曝光数","点击率","answer链接"))
for i in result_lst: for i in result_lst:
for j in i: for j in i:
f.write(tplt.format(j[0],j[1],j[2],j[3],j[4],j[5])) f.write(tplt.format(j[0],j[1],j[2],j[3],"{}%".format(round(j[4]*100,2)),j[5]))
f.write("=================================================================\n") f.write("=================================================================\n")
if i != result_lst[-1]: if i != result_lst[-1]:
f.write(tplt.format("平台","answer_id","点击数","曝光数","点击率","answer链接")) f.write(tplt.format("平台","answer_id","点击数","曝光数","点击率","answer链接"))
......
...@@ -26,7 +26,7 @@ def result2file(result_lst,fpath): ...@@ -26,7 +26,7 @@ def result2file(result_lst,fpath):
f.write(tplt.format("平台","diary_id","点击数","曝光数","点击率","diary链接")) f.write(tplt.format("平台","diary_id","点击数","曝光数","点击率","diary链接"))
for i in result_lst: for i in result_lst:
for j in i: for j in i:
f.write(tplt.format(j[0],j[1],j[2],j[3],j[4],j[5])) f.write(tplt.format(j[0],j[1],j[2],j[3],"{}%".format(round(j[4]*100,2)),j[5]))
f.write("=================================================================\n") f.write("=================================================================\n")
if i != result_lst[-1]: if i != result_lst[-1]:
f.write(tplt.format("平台","diary_id","点击数","曝光数","点击率","diary链接")) f.write(tplt.format("平台","diary_id","点击数","曝光数","点击率","diary链接"))
......
...@@ -26,7 +26,7 @@ def result2file(result_lst,fpath): ...@@ -26,7 +26,7 @@ def result2file(result_lst,fpath):
f.write(tplt.format("平台","question_id","点击数","曝光数","点击率","question链接")) f.write(tplt.format("平台","question_id","点击数","曝光数","点击率","question链接"))
for i in result_lst: for i in result_lst:
for j in i: for j in i:
f.write(tplt.format(j[0],j[1],j[2],j[3],j[4],j[5])) f.write(tplt.format(j[0],j[1],j[2],j[3],"{}%".format(round(j[4]*100,2)),j[5]))
f.write("=================================================================\n") f.write("=================================================================\n")
if i != result_lst[-1]: if i != result_lst[-1]:
f.write(tplt.format("平台","question_id","点击数","曝光数","点击率","question链接")) f.write(tplt.format("平台","question_id","点击数","曝光数","点击率","question链接"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment