Commit 626b43f5 authored by 李小芳's avatar 李小芳

update

parent aeb48597
...@@ -89,43 +89,5 @@ def get_cika_info_to_csv(): ...@@ -89,43 +89,5 @@ def get_cika_info_to_csv():
write_file.close() write_file.close()
def read_cika_info():
all_cika_title = {}
cika_file = open("soyoung_service_cika.csv", "r", encoding="utf-8")
for item in cika_file.readlines():
cika = eval(item)
for key, values in cika.items():
all_cika_title[key] = values
print(all_cika_title)
cika_file.close()
return all_cika_title
def write_service_info_to_csv():
all_cika_sub = ['单次', '2次', '3次', '4次', '5次', '6次', '8次', '9次', '10次', '20次' '门市价']
read_file = open("soyoung_service.csv", "r", encoding="utf-8")
write_file = open("soyoung_service_write_cika.csv", "w", encoding="utf-8")
all_cika_title = read_cika_info()
for item in read_file.readlines():
try:
service_info = item.strip().split(",")
print("service_info", service_info)
service_id = service_info[2]
cika_info = all_cika_title.get(service_id)
if cika_info:
print('cika_info:', cika_info)
for cika in all_cika_sub:
service_info.append(cika_info.get(cika, ""))
write_file.write(str(service_info))
write_file.write("\n")
except Exception as e:
print("eeeeee:", e)
pass
read_file.close()
write_file.close()
if __name__ == '__main__': if __name__ == '__main__':
get_cika_info_to_csv() get_cika_info_to_csv()
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