There's nothing wrong with the way you are reading data (with for loop, not the second read with readlines) , or
populating the values.
The problem is with range!
you are trying to read 10 lines
you are also trying to read two records at a time
but data runs out before that, thus the error.
The following will work:
populating the values.
The problem is with range!
you are trying to read 10 lines
you are also trying to read two records at a time
but data runs out before that, thus the error.
The following will work:
with open("data.txt","r") as f: for ligne in f: print(ligne) t, h, Text, Tint, lux = ligne.strip().split("\t")