Hi all,
trying to write a program that will read a file in like:
python myprog < inputFile
the program needs to store each line a an entry in a list.
This code works but you have to hard code how many lines there will be (see comment). I need my program to terminate at the EOF. I have looked around for a couple hours but havent had enormous luck finding anything.
Tryed entering in
and similar but not having to much luck. Thanks for reading!
JS
trying to write a program that will read a file in like:
python myprog < inputFile
the program needs to store each line a an entry in a list.
Code:
li = [] for i in range(0,9): #<- these must be the correct range. temp = raw_input("") li.append(temp)
This code works but you have to hard code how many lines there will be (see comment). I need my program to terminate at the EOF. I have looked around for a couple hours but havent had enormous luck finding anything.
Tryed entering in
Code:
if(temp==\0): break
JS
Comment