Kaydet (Commit) 6f937b1c authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

[Bug #998307] Use open() instead of file() in docs

üst 9bae19e8
......@@ -314,7 +314,7 @@ The ``Hello, world'' of csv reading is
\begin{verbatim}
import csv
reader = csv.reader(file("some.csv", "rb"))
reader = csv.reader(open("some.csv", "rb"))
for row in reader:
print row
\end{verbatim}
......@@ -323,7 +323,7 @@ To print just the first and last columns of each row try
\begin{verbatim}
import csv
reader = csv.reader(file("some.csv", "rb"))
reader = csv.reader(open("some.csv", "rb"))
for row in reader:
print row[0], row[-1]
\end{verbatim}
......@@ -332,7 +332,7 @@ The corresponding simplest possible writing example is
\begin{verbatim}
import csv
writer = csv.writer(file("some.csv", "wb"))
writer = csv.writer(open("some.csv", "wb"))
for row in someiterable:
writer.writerow(row)
\end{verbatim}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment