How to read one byte at a time in Python?

Anthony Liu antonyliu2002 at
Sat Mar 13 09:29:09 CET 2004

Yes, during file input, I think that read(1) should
satisfy my needs.  Although in some cases, I will have
to do read(2) for Chinese characters.


--- Peter Hansen <peter at> wrote:
> Anthony Liu wrote:
> > Java has functions that read only one byte at a
> time,
> > do we have such a function in python?
> Skip assumed you meant during user input.  Is that
> what you meant, or 
> did you mean during input from a file or something? 
> read(1) would do 
> that, of course...
> -Peter
> -- 

Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam

More information about the Python-list mailing list