add feature

This commit is contained in:
baol 2024-11-28 14:27:56 +08:00
parent d0d120130b
commit 77b6e0c14f

View File

@ -27,11 +27,22 @@ def read_binary_file(file_path):
time_bytes = file.read(8)
time = struct.unpack("<d", time_bytes)[0]
print(f"Time: {time}")
for i in range(column_count_int):
print(i)
data_bytes = file.read(8)
data = struct.unpack("<d", data_bytes)[0]
print(f"Data: {data}")
data_size = column_count_int * 8 # 每个数据点8个字节
file.seek(data_size, 1)
time1_bytes = file.read(8)
time1 = struct.unpack("<d", time1_bytes)[0]
print(f"Time: {time1}")
file.seek(data_size, 1)
time2_bytes = file.read(8)
time2 = struct.unpack("<d", time2_bytes)[0]
print(f"Time: {time2}")
# for i in range(column_count_int):
# print(i)
# if i > 10:
# break
# data_bytes = file.read(8)
# data = struct.unpack("<d", data_bytes)[0]
# print(f"Data: {data}")
# while True:
# # print("index", index)
# if index > 335: