Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > read text file byte by byte

Reply
Thread Tools

read text file byte by byte

 
 
Nobody
Guest
Posts: n/a
 
      12-16-2009
On Mon, 14 Dec 2009 21:37:33 -0300, Gabriel Genellina wrote:

>> There are no file objects in 3.x. The file() function no longer
>> exists. The return value from open(), will be an instance of
>> _io.<something> depending upon the mode, e.g. _io.TextIOWrapper for 'r',
>> _io.BufferedReader for 'rb', _io.BufferedRandom for 'w+b', etc.
>>
>> http://docs.python.org/3.1/library/io.html
>>
>> io.IOBase.read() doesn't exist, io.RawIOBase.read(n) reads n bytes,
>> io.TextIOBase.read(n) reads n characters.

>
> So basically this section [1] should not exist, or be completely rewritten?


It should probably be changed to refer to "the file interface" or similar,
rather than removed altogether.

The io documentation may be unnecessary detail for many users. It would be
better to provide a more general overview, with a link to the io
package for those interested in the precise details. Also, removing the
section on "file objects" altogether is likely to be unhelpful for people
migrating from 2.x to 3.x.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File.read(fname) vs. File.read(fname,File.size(fname)) Alex Dowad Ruby 4 05-01-2010 08:20 AM
Read a file line by line and write each line to a file based on the5th byte scad C++ 23 05-17-2009 06:11 PM
how to read/write a characters stream which is either of one byte/2 byte Deep C Programming 6 02-28-2007 01:03 PM
read/write data byte-per-byte to and from a socket crash.test.dummy Java 1 02-17-2006 06:18 AM
Read Text File and split them to individual text file Krish ASP .Net 1 10-20-2005 03:39 PM



Advertisments