Re: Help to convert Number to String

2010-08-13 Thread Ben Finney
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

Re: Help to convert Number to String

2010-08-13 Thread Vamsi
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

Re: Help to convert Number to String

2010-08-13 Thread Vamsi
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

Re: Help to convert Number to String

2010-08-13 Thread Steven D'Aprano
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

Re: Help to convert Number to String

2010-08-13 Thread Stefan Schwarzer
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

Help to convert Number to String

2010-08-13 Thread Vamsi
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