Use with statement where it improves the documentation (closes #10461)

This commit is contained in:
Éric Araujo 2011-03-11 17:42:48 +01:00
parent 17b880a5d6
commit a3dd56b6cf
5 changed files with 16 additions and 8 deletions

View file

@ -141,7 +141,9 @@ standard size and in little-endian byte order::
import struct
data = open('myfile.zip', 'rb').read()
with open('myfile.zip', 'rb') as f:
data = f.read()
start = 0
for i in range(3): # show the first 3 file headers
start += 14