Vamsi writes:
> fileopen = open('C:/MPython/test.txt', 'r')
> str = fileopen.read()
The above statement clobbers the existing binding of ‘str’ to the
built-in string type. From that point on, the built-in string type is no
longer accessible by the name ‘str’; that name accesses a different
objec
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 buffer, not int", Could you please
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 character buffer, not int", Could you pleas
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 buffer, not int", Could you please help me how to
> correct this?
>
>
> here is the
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 character buffer, not int", Could you please help me how to
> correct this?
Which Python version do
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