Replacing line in a text file

Neil Cerutti horpner at yahoo.com
Fri Sep 22 13:44:49 EDT 2006


On 2006-09-22, CSUIDL PROGRAMMEr <syedamjad_a at yahoo.com> wrote:
> Folks
> I am trying to read a file
> This file has a line containing string  'disable = yes'
>
> I want to change this line to 'disable = no'
>
> The concern here is that , i plan to take into account the white spaces
> also.
>
> I tried copying all file int list and then tried to manipulate that
> list
>
> But the search is not working
>
> Any answer

More code, less talk.

Seriously, posting your code and any error messages or unexpected
results you're getting would be helpful. That is, until such time
as Guido finalizes PyESP.

import PyESP
e = ESP.mindread(CSUIDL, "r")
# etc..

-- 
Neil Cerutti
Life is indeed precious, and I believe the death penalty helps
affirm this fact. --Edward Koch



More information about the Python-list mailing list