The example files need to be opened with the "b" flag.
This commit is contained in:
parent
1281f76606
commit
bdda9f389a
|
@ -312,7 +312,7 @@ The ``Hello, world'' of csv reading is
|
||||||
|
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
import csv
|
import csv
|
||||||
reader = csv.reader(file("some.csv"))
|
reader = csv.reader(file("some.csv", "rb"))
|
||||||
for row in reader:
|
for row in reader:
|
||||||
print row
|
print row
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
@ -321,7 +321,7 @@ The corresponding simplest possible writing example is
|
||||||
|
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
import csv
|
import csv
|
||||||
writer = csv.writer(file("some.csv", "w"))
|
writer = csv.writer(file("some.csv", "wb"))
|
||||||
for row in someiterable:
|
for row in someiterable:
|
||||||
writer.writerow(row)
|
writer.writerow(row)
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
Loading…
Reference in New Issue