diff options
| author | Tim Graham <timograham@gmail.com> | 2013-06-14 21:28:17 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-06-14 21:28:17 -0400 |
| commit | a1122e14a6d2ace8907923507e7d31c44a6f7c68 (patch) | |
| tree | f024ee400d0e130a46bb1de83ddf5e7c374b3208 /docs/topics/files.txt | |
| parent | 2a6a32047d7d1c19e3e9f6d317cbe33e7d6ab49a (diff) | |
Fixed #20604 - Fixed file example in docs.
Thanks Chris Lasher for the report.
Diffstat (limited to 'docs/topics/files.txt')
| -rw-r--r-- | docs/topics/files.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/topics/files.txt b/docs/topics/files.txt index 492e6a20b5..45f83d8746 100644 --- a/docs/topics/files.txt +++ b/docs/topics/files.txt @@ -87,9 +87,9 @@ The following approach may be used to close files automatically:: # Create a Python file object using open() and the with statement >>> with open('/tmp/hello.world', 'w') as f: - >>> myfile = File(f) - >>> for line in myfile: - >>> print line + ... myfile = File(f) + ... myfile.write('Hello World') + ... >>> myfile.closed True >>> f.closed |
