brisonus_app_eq/ERNCTuningTool/test/test_data_process.py

9 lines
264 B
Python
Raw Permalink Normal View History

2025-02-18 22:05:52 +08:00
# 方法1使用strip()和replace()
with open('numbers.dat', 'r') as file:
numbers = []
for line in file:
# 去除空白字符和逗号,转换为整数
num = int(line.strip().replace(',', ''))
numbers.append(num)
print(numbers)