[DB-SIG] reg File Reading
python at venix.com
Thu Feb 23 13:21:10 CET 2006
On Thu, 2006-02-23 at 22:34 +1100, Andy Todd wrote:
> 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
Actually the Python Tutor list will help you with these kinds of
problems. Please sign up and send your questions to the Tutors.
Here is the beginner guide page from the Python Web site.
More information about the DB-SIG