[DB-SIG] reg File Reading

Andy Todd andy47 at halfcooked.com
Thu Feb 23 12:34:28 CET 2006

python eager wrote:
> Hi,
>   This is my code snippet. This code will not read the characters in Ms 
> Word Document. I got the below output. But if i use any *txt* format 
> this will be display properly. Instead of txt format i am using doc 
> format. I got error while reading. please help me to solve this problem
>           req = self.request()
>           inp = file('C:\\Python.doc','r')
>           for line in inp:
>              self.writeln(line)
>           inp.close()
> *Output :*
> *    ÐÏࡱ*
> regards!
> Python eager

Your code will read and process a text file. Microsoft Word produces 
binrary files. Please RTFM.

This is not a database question. If after consulting 
http://docs.python.org http://www.diveintopython.org and 
http://aspn.activestate.com/ASPN/Python/Cookbook/ you still don't have a 
solution I'd suggest you ask on comp.lang.python

 From the desk of Andrew J Todd esq - http://www.halfcooked.com/

More information about the DB-SIG mailing list