From 8c82f7c266b553831b53c86f160009217ff7945d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 10 Sep 2019 17:21:57 +0200 Subject: [PATCH] CSV --- README.md | 3 ++- index.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1e3a7e3..a516d8b 100644 --- a/README.md +++ b/README.md @@ -1686,6 +1686,7 @@ import csv ```python = csv.reader(, dialect='excel', delimiter=',') = next() # Returns next row as a list of strings. + = list() # Returns list of remaining rows. ``` * **File must be opened with `'newline=""'` argument, or newlines embedded inside quoted fields will not be interpreted correctly!** @@ -1693,7 +1694,7 @@ import csv ```python = csv.writer(, dialect='excel', delimiter=',') .writerow() # Encodes objects using `str()`. -.writerows() +.writerows() # Appends multiple rows. ``` * **File must be opened with `'newline=""'` argument, or an extra '\r' will be added on platforms that use '\r\n' linendings!** diff --git a/index.html b/index.html index 7947901..d1484b0 100644 --- a/index.html +++ b/index.html @@ -1517,6 +1517,7 @@ shutil.copytree(from, to) # Copies the entir

Read

<reader> = csv.reader(<file>, dialect='excel', delimiter=',')
 <list>   = next(<reader>)           # Returns next row as a list of strings.
+<list>   = list(<reader>)           # Returns list of remaining rows.
 
    @@ -1524,7 +1525,7 @@ shutil.copytree(from, to) # Copies the entir

Write

<writer> = csv.writer(<file>, dialect='excel', delimiter=',')
 <writer>.writerow(<collection>)     # Encodes objects using `str(<el>)`.
-<writer>.writerows(<coll_of_coll>)
+<writer>.writerows(<coll_of_coll>)  # Appends multiple rows.