> > Ok, perhaps I'm being a little dim but if I do > > s = 'Spam is not ham' > s.replace('Spam', '') > and write it to a new file, should I not get 'is not ham'? > > Instead I am getting an empty file or in the case of multiple lines in > the file, the whole of the line 'Spam is not ham' is gone but 'I'm fond > of ham' remains. > s should be left completely alone as your code is right now.