Commit 4d47ba28 by larosa

add script

parent 133f5948
Showing with 7 additions and 8 deletions
...@@ -180,7 +180,7 @@ class DataUtil: ...@@ -180,7 +180,7 @@ class DataUtil:
with open(file_path, errors='ignore') as f: with open(file_path, errors='ignore') as f:
content_list = f.readlines() content_list = f.readlines()
for index in range(len(content_list)): for index in range(len(content_list)):
if index > 10: if index > 100:
break break
if index == 0: if index == 0:
continue continue
...@@ -238,16 +238,15 @@ class DataUtil: ...@@ -238,16 +238,15 @@ class DataUtil:
ladder_prices["price-jpy-6"] = element ladder_prices["price-jpy-6"] = element
if table["goods_name"] == "" or table["brand_name"] == "": if table["goods_name"] == "" or table["brand_name"] == "":
continue continue
a = 1
for k in range(1, 7): for k in range(1, 7):
if "price-break-" + str(i) in ladder_purchases \ if ("price-break-" + str(k)) in ladder_purchases \
and "price-jpy-" + str(i) in ladder_prices \ and ("price-jpy-" + str(k)) in ladder_prices \
and is_number(ladder_purchases["price-break-" + str(i)]) \ and is_number(ladder_purchases["price-break-" + str(k)]) \
and is_number(ladder_prices["price-jpy-" + str(i)]): and is_number(ladder_prices["price-jpy-" + str(k)]):
item = dict() item = dict()
item["purchases"] = int(ladder_purchases["price-break-" + str(i)]) item["purchases"] = int(ladder_purchases["price-break-" + str(k)])
item["price_us"] = float(0) item["price_us"] = float(0)
item["price_cn"] = float(ladder_prices["price-jpy-" + str(i)]) item["price_cn"] = float(ladder_prices["price-jpy-" + str(k)])
table["ladder_price"].append(item) table["ladder_price"].append(item)
ans = json.dumps(table) ans = json.dumps(table)
print(ans) print(ans)
......
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 sign in to comment