Eric Sauer
Eric Sauer

Reputation: 870

Python: What does file.read() do?

So I'm trying to read the bytes of a file. I created a script that just uses file.read() and it iterates through the bytes. It comes to a character where is looks like

[ 0 0 ]
[ 0 3 ]

I guess my real question is: What does this character repersent? When I look at a Hex Editor, it displays it as ú which makes sense because the hexidecimal is FA.

Upvotes: 2

Views: 794

Answers (1)

Daniel Li
Daniel Li

Reputation: 15379

file.read will take the binary contents of your declared file and stuff it into a buffer.

00 and 03 are control characters (00 = NULL, 03 = END OF TEXT). You may be interested in referring to an ASCII table for more details.

ASCII Table: http://www.asciitable.com/index/asciifull.gif

Upvotes: 5

Related Questions