Text file content is
1 0.552344 0.384028 0.159375 0.195833
1 0.780078 0.595833 0.236719 0.133333
It's like this After executing Python code [1 0.552344 0.384028 0.159375 0.195833] , [1 0.780078 0.595833 0.236719 0.133333] I want to print it out as a list. What should I do? ㅠ<
python list data
You can use the readlines function to read the contents of the file in the form of a list in line units.
file = open("something.txt", "r")
lines = file.readlines()
print(lines)
© 2024 OneMinuteCode. All rights reserved.