Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.5.x] Fixed #20604 - Fixed file example in docs.

Thanks Chris Lasher for the report.

Backport of a1122e1 from master
  • Loading branch information...
commit e411e9931272cd22247095fc2af8d26d58eeddd6 1 parent e65f0c2
Tim Graham authored

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  docs/topics/files.txt
6  docs/topics/files.txt
@@ -85,9 +85,9 @@ The following approach may be used to close files automatically::
85 85
 
86 86
     # Create a Python file object using open() and the with statement
87 87
     >>> with open('/tmp/hello.world', 'w') as f:
88  
-    >>>     myfile = File(f)
89  
-    >>>     for line in myfile:
90  
-    >>>         print line
  88
+    ...     myfile = File(f)
  89
+    ...     myfile.write('Hello World')
  90
+    ...
91 91
     >>> myfile.closed
92 92
     True
93 93
     >>> f.closed

0 notes on commit e411e99

Please sign in to comment.
Something went wrong with that request. Please try again.