Fix broken example of csv.reader use (it returns an iterator, which isn't

indexable) by using the same 'for' construct as all other examples. (Also
emphasizes that reading from a random iterable is no different than reading
from a file.)
This commit is contained in:
Thomas Wouters 2006-02-16 14:57:05 +00:00
parent 41290685f9
commit bbdf6078f6
1 changed files with 2 additions and 1 deletions

View File

@ -421,7 +421,8 @@ easily be done:
\begin{verbatim}
import csv
print csv.reader(['one,two,three'])[0]
for row in csv.reader(['one,two,three']):
print row
\end{verbatim}
The \module{csv} module doesn't directly support reading and writing