Nov-24-2017, 09:44 PM
Hi! I'm attempting to take calculated values from a loop and output them into a text file. I currently have:
fout = open("Wishbone 1N-24HZ Output.txt", "w") while p!=W: fout.write("{:f} {:f} {:f} {:f} \n".format(NewTVD[i], NewN[i], NewE[i], DLS[i])) p=p+1 fout.close()W is a count of the number of values in a list that is read from an input text file.
I have the variables defined as lists and calculates values being put in:
DLS=[]
dls =... DLS.append(dls)I keep getting an error of "list index out of range" and I'm not sure what that means or how to fix it. I'm using Spyder, and the DLS list does not show up in the variable explorer when I run through my loop to calculate that. I'm not sure if that is a clue to what is going wrong. I'm fairly new to coding in Python.