brisonus_app_eq/ERNCTuningTool/test/test_data_process.py
2025-02-18 22:05:52 +08:00

9 lines
264 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 方法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)