From bbdf6078f689aca2c8443db652a93d253698d040 Mon Sep 17 00:00:00 2001 From: Thomas Wouters Date: Thu, 16 Feb 2006 14:57:05 +0000 Subject: [PATCH] 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.) --- Doc/lib/libcsv.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/lib/libcsv.tex b/Doc/lib/libcsv.tex index 86d102551e..22cfda5e44 100644 --- a/Doc/lib/libcsv.tex +++ b/Doc/lib/libcsv.tex @@ -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 -- 2.40.0