On 10Apr2013 21:50, nagia.rets...@gmail.com <nagia.rets...@gmail.com> wrote: | Firtly thank uou for taking a look into the code. | the doctype is coming form the attempt of script metrites.py to open and read the 'index.html' file. | But i don't know how to try to open it as a byte file instead of an tetxt file.
I think you've got it backwards. It looks like metrites.py has opened the file as bytes instead of as text (probably utf8, but that remains to be seen). Because it has opened it in binary mode you're getting bytes when you read from the file. Can you show the relevant code that opens the files and reads from it, and the print statement that is putting it back out? You probably need to ensure that metrites.py is opening it as text, with the correct encoding. Note that the encoding is nothing to do with your _output_. It is the encoding of the data in the file you are reading, and that is dictated by the editor used to make the file. Anyway, code first. What does it look like? Cheers, -- Cameron Simpson <c...@zip.com.au> Six trillion RFID tags is four orders of magnitude bigger than any electronic item ever made. - overhead by WIRED at the Intelligent Printing conference Oct2006 -- http://mail.python.org/mailman/listinfo/python-list