Re: How to read one byte at a time in Python?
From: Garry Knight (garryknight_at_gmx.net)
Date: 03/13/04
- Next message: Erik Max Francis: "Re: put your money where your mouse is, or why I prefer Spanish to English: a proposal"
- Previous message: David MacQuigg: "Re: Deprecating reload() ???"
- In reply to: Anthony Liu: "How to read one byte at a time in Python?"
- Next in thread: Peter Hansen: "Re: How to read one byte at a time in Python?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 13 Mar 2004 01:21:00 +0000
In message <mailman.335.1079137564.19534.python-list@python.org>, Anthony
Liu wrote:
> Java has functions that read only one byte at a time,
> do we have such a function in python?
inf = open('filename', 'r')
c = inf.read(1)
Depending on the meaning of the word 'byte' in your question, you might want
to make the file mode 'rb'.
-- Garry Knight garryknight@gmx.net ICQ 126351135 Linux registered user 182025
- Next message: Erik Max Francis: "Re: put your money where your mouse is, or why I prefer Spanish to English: a proposal"
- Previous message: David MacQuigg: "Re: Deprecating reload() ???"
- In reply to: Anthony Liu: "How to read one byte at a time in Python?"
- Next in thread: Peter Hansen: "Re: How to read one byte at a time in Python?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|