commit | a3dd56b6cffaeee21fec6529b212fd4fa98c1ea8 | [log] [tgz] |
---|---|---|
author | Éric Araujo <merwok@netwok.org> | Fri Mar 11 17:42:48 2011 +0100 |
committer | Éric Araujo <merwok@netwok.org> | Fri Mar 11 17:42:48 2011 +0100 |
tree | 6b9fe78b2e36d78d159216950039a033ba9311a8 | |
parent | 17b880a5d6b64f1e7d26ec8229e8b41cdf740690 [diff] |
Use with statement where it improves the documentation (closes #10461)
diff --git a/Doc/tutorial/stdlib2.rst b/Doc/tutorial/stdlib2.rst index 603f143..85c88dc 100644 --- a/Doc/tutorial/stdlib2.rst +++ b/Doc/tutorial/stdlib2.rst
@@ -141,7 +141,9 @@ 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