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 = open('C:/test1.txt'', 'a')
wfile.write(str(lines1).zfill(9))
wfile.close()

Thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to