add feature
This commit is contained in:
parent
d0d120130b
commit
77b6e0c14f
21
read_dat.py
21
read_dat.py
@ -27,11 +27,22 @@ def read_binary_file(file_path):
|
|||||||
time_bytes = file.read(8)
|
time_bytes = file.read(8)
|
||||||
time = struct.unpack("<d", time_bytes)[0]
|
time = struct.unpack("<d", time_bytes)[0]
|
||||||
print(f"Time: {time}")
|
print(f"Time: {time}")
|
||||||
for i in range(column_count_int):
|
data_size = column_count_int * 8 # 每个数据点8个字节
|
||||||
print(i)
|
file.seek(data_size, 1)
|
||||||
data_bytes = file.read(8)
|
time1_bytes = file.read(8)
|
||||||
data = struct.unpack("<d", data_bytes)[0]
|
time1 = struct.unpack("<d", time1_bytes)[0]
|
||||||
print(f"Data: {data}")
|
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:
|
# while True:
|
||||||
# # print("index", index)
|
# # print("index", index)
|
||||||
# if index > 335:
|
# if index > 335:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user