Does Python support a peek like method for its file objects?

Avi Kak kak at purdue.edu
Sun Feb 5 00:45:24 EST 2006



Hello:

  Does Python support a peek like method for its file objects?

  I'd like to be able to look at the next byte in a disk file before
  deciding whether I should read it with, say, the read() method.
  Is it possible to do so in Python?

  Your answer would be much appreciated.

  Thanks.

Avi Kak



More information about the Python-list mailing list