Browse files

Fixed #20604 - Fixed file example in docs.

Thanks Chris Lasher for the report.
  • Loading branch information...
1 parent 2a6a320 commit a1122e14a6d2ace8907923507e7d31c44a6f7c68 @timgraham timgraham committed Jun 15, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 docs/topics/files.txt
View
6 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

0 comments on commit a1122e1

Please sign in to comment.