| | |
| | | lines = file.readlines() |
| | | for line in lines: |
| | | start_index = line.find("]") |
| | | if start_index<0: |
| | | if start_index < 0: |
| | | continue |
| | | line = line[start_index + 1:].strip() |
| | | data = eval(line) |
| | |
| | | return fdatas |
| | | |
| | | |
| | | def load_big_buy_order(date=tool.get_now_date_str()): |
| | | """ |
| | | 获取大买单 |
| | | :param date: |
| | | :return: |
| | | """ |
| | | path = f"{constant.get_path_prefix()}/{constant.LOG_DIR}/huaxin/l2/transaction_big_buy.{date}.log" |
| | | fdatas = {} |
| | | with open(path, 'r') as file: |
| | | lines = file.readlines() |
| | | for line in lines: |
| | | start_index = line.find("]") |
| | | if start_index < 0: |
| | | continue |
| | | line = line[start_index + 1:].strip() |
| | | ds = line.split("#") |
| | | code = ds[0].strip() |
| | | data = eval(ds[1]) |
| | | if code not in fdatas: |
| | | fdatas[code] = [] |
| | | fdatas[code].append(data) |
| | | return fdatas |
| | | |
| | | |
| | | if __name__ == "__main__": |