From 05b468b3576318413cd7dfc3fd6d414afa6041cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 21 Jul 2019 02:42:09 +0200 Subject: [PATCH] CSV --- README.md | 6 +++--- index.html | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 67ed146..28e51d7 100644 --- a/README.md +++ b/README.md @@ -1651,12 +1651,12 @@ CSV ```python import csv = csv.reader(, dialect='excel', delimiter=',') - = next() # Returns a row as list of strings. + = next() # Returns next row as list of strings. ``` ```python = csv.writer(, dialect='excel', delimiter=',') -.writerow() # Encodes objects using `str()`. +.writerow() # Encodes objects using `str()`. .writerows() ``` * **File must be opened with `'newline=""'` argument, or newlines embedded inside quoted fields will not be interpreted correctly!** @@ -1669,7 +1669,7 @@ import csv * **`'skipinitialspace'` - Whether whitespace after delimiter gets stripped.** * **`'lineterminator'` - How does writer terminate lines.** * **`'quoting'` - Controls the amount of quoting: 0 - as necessary, 1 - all.** -* **`'escapechar'` - Character for escaping quotechar if doublequote is false.** +* **`'escapechar'` - Character for escaping 'quotechar' if 'doublequote' is false.** ### Dialects ```text diff --git a/index.html b/index.html index 5851b17..6e55e3f 100644 --- a/index.html +++ b/index.html @@ -1481,11 +1481,11 @@ os.replace(from, to) # Same, but overwr

#CSV

import csv
 <reader> = csv.reader(<file>, dialect='excel', delimiter=',')
-<list>   = next(<reader>)        # Returns a row as list of strings.
+<list>   = next(<reader>)          # Returns next row as list of strings.
 
<writer> = csv.writer(<file>, dialect='excel', delimiter=',')
-<writer>.writerow(<collection>)  # Encodes objects using `str(<el>)`.
+<writer>.writerow(<collection>)    # Encodes objects using `str(<el>)`.
 <writer>.writerows(<coll_of_coll>)
 
    @@ -1499,7 +1499,7 @@ os.replace(from, to) # Same, but overwr
  • 'skipinitialspace' - Whether whitespace after delimiter gets stripped.
  • 'lineterminator' - How does writer terminate lines.
  • 'quoting' - Controls the amount of quoting: 0 - as necessary, 1 - all.
  • -
  • 'escapechar' - Character for escaping quotechar if doublequote is false.
  • +
  • 'escapechar' - Character for escaping 'quotechar' if 'doublequote' is false.

Dialects

+------------------+-----------+-----------+--------------+
 |                  |   excel   | excel_tab | unix_dialect |
 +------------------+-----------+-----------+--------------+