I have to change the res
variable value in the next code for every loop it does.
txt = open(os.path.expanduser('~FOLDER\\numbers.txt'), 'r')
res = txt.read().splitlines()
u = [something]
for item in u:
var['Number : ' + res[0]]
txt
variable contains a text file. In this text file there some lines of numbers in this format:
123
1234
125342
562546
I have to take a variable for each loop the script does and assign to res
. At the moment, with res[0]
it only iterate the same number (ex: 123) on every loop. How can I solve the problem ?
It should be 0 at first, 1 at second ad so on...