so here my code
arr = []
inp = open ("test.txt","r")
for line in inp.readlines():
for i in line.split():
arr.append(i)
print arr
and the output for arr is [] and if i try to print arr[0] or anything it says the index is out of range im trying to take the data out of the text and put it into array for use or even a list i could read the data off of ive tried alot ways this seemed to be the easiest in my wrong opinion i guess lol
all since im here asking id also like to search that document for a line that starts with say “start” and but that data into the array or list what might be the best way to go about that and thanks for the help also im new to python and its really late so this is my last resort
The code is all right. Either
test.txtis empty, or this is not the right piece of code, or you have edited something important out of it.