> I know I am wrong here because I do not know how to
> search and remove an element in a list. Can any one
> please help me. 

This is what the filter function is for...
But you can use list comprehensions too:

[element for element in list if element not foo]

so in your case:

lst = f.readlines()  # get file into a list
lst = [line for line in lst if not line.startswith('Name=')]

Or something very similar. For more control use a regular
expression to filter the lines

Alan G.

_______________________________________________
Tutor maillist  -  [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to