Commit 77fd440a authored by 赵威's avatar 赵威

write dict to csv

parent 46b1bed5
...@@ -27,7 +27,7 @@ def save_dict_to_csv(d, file): ...@@ -27,7 +27,7 @@ def save_dict_to_csv(d, file):
print(full_path) print(full_path)
remove_file(full_path) remove_file(full_path)
with open(full_path, "w") as f: with open(full_path, "w") as f:
for (k, v) in d.items: for (k, v) in d.items():
if v: if v:
f.write("{}|{}\n".format(k, ",".join([str(x) for x in v]))) f.write("{}|{}\n".format(k, ",".join([str(x) for x in v])))
......
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