open() is a function (well not really, but calling it a method in one sentence and a function in the next just seems wrong)

This commit is contained in:
Mark Pilgrim
2009-08-25 16:43:44 -04:00
parent 304949b68c
commit f83ffbcdcd
+1 -1
View File
@@ -279,7 +279,7 @@ ValueError: zero length field name in format</samp></pre>
<p>You can write to files in much the same way that you read from them. First you open a file and get a stream object, then you use methods on the stream object to write data to the file, then you close the file.
<p>To open a file for writing, use the <code>open()</code> method and specify the write mode. There are two file modes for writing:
<p>To open a file for writing, use the <code>open()</code> function and specify the write mode. There are two file modes for writing:
<ul>
<li>&#8220;Write&#8221; mode will overwrite the file. Pass <code>mode='w'</code> to the <code>open()</code> function.