On Aug 13, 9:06 pm, Steven D'Aprano wrote:
> On Fri, 13 Aug 2010 13:50:48 -0700, Vamsi wrote:
> > I am trying to count the number of lines in a file and insert into the
> > file but getting the error message "TypeError: must be string or
> > read-only character buf
On Aug 13, 7:27 pm, Stefan Schwarzer
wrote:
> Hi Vamsi,
>
> On 2010-08-13 22:50, Vamsi wrote:
>
> > I am trying to count the number of lines in a file and insert into
> > the file but getting the error message "TypeError: must be string or
> > read-only ch
I am trying to count the number of lines in a file and insert into
the file but getting the error message "TypeError: must be string or
read-only character buffer, not int", Could you please help me how to
correct this?
here is the code
lines1 = sum(1 for line in open('C:/test1.txt'))
wfile = o