mike g
Posts: 1
Nickname: gotohell
Registered: Apr, 2006
|
|
check the first letter in every row
|
Posted: Apr 6, 2006 6:25 AM
|
|
|
Advertisement
|
Hello.. I'm trying to write a function that will check if the first letter in every row IN a textfile is what I want.
I've come this far, but don't know how to go on..
def selectOne(self): thefile = open("people.txt", "r") choice = int(raw_input("Enter ID-number: ")) for line in thefile: print thefile.read(1) thefile.close()
if I do this.. It just returns five empty rows.. There is 5 lines in my txt.
someone who can give me some hints?
|
|