Re: Search-and-delete text processing problem...

2005-04-01 Thread M.E.Farmer
My apologies you did indeed use writelines correctly ;) dohhh! I had a gut reaction to this. Py>f = ['hij\n','efg\n','abc\n'] Py> for i in f: ... if i.startswith('a'): ... i == '' Py> f ['hij\n', 'efg\n', 'abc\n'] Notice that it does not modify the list in any way. You are trying to loo

Re: Search-and-delete text processing problem...

2005-04-01 Thread M.E.Farmer
Strings have many methods that are worth learning. If you haven't already discovered dir(str) try it. Also I am not sure if you were just typing in some pseudocode, but your use of writelines is incorrect. help(file.writelines) Help on built-in function writelines: writelines(...) writelines(s

Re: Search-and-delete text processing problem...

2005-04-01 Thread lostboard2001
Close: > if line[:4] == 'Bill': . ^^ > line == ' ' > -- http://mail.python.org/mailman/listinfo/python-list