File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Python/Module5_OddsAndEnds Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -135,9 +135,9 @@ The following code opens the file "file1.txt" for writing:
135
135
path_to_file = Path(" file1.txt" )
136
136
with open (path_to_file, mode = " w" ) as f:
137
137
# The indented space enters the "context" of the open file.
138
- # Leaving the indented space exist the context of the opened file, forcing
139
- # the file to be closed. This is ensured even if our code causes an error
140
- # within this indented block
138
+ # Leaving the indented space exits the context of the opened file, forcing
139
+ # the file to be closed. This is ensured even if the code within the indented
140
+ # block causes an error.
141
141
f.write(' this is a line.\n This is a second line.\n This is the third line.' )
142
142
143
143
# The file is closed here.
You can’t perform that action at this time.
0 commit comments