From 5723f8af77a67e0ad1466a076a64809af729dc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 17 Jul 2019 18:24:32 +0200 Subject: [PATCH] CSV --- README.md | 2 +- index.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6be8667..6648436 100644 --- a/README.md +++ b/README.md @@ -1661,6 +1661,7 @@ import csv .writerow() # Encodes objects using `str()`. .writerows() ``` +* **File must be open with `'newline=""'` argument, or newlines embedded inside quoted fields will not be interpreted correctly!** ### Parameters * **`'dialect'` - Master parameter that sets the default values.** @@ -1693,7 +1694,6 @@ def read_csv_file(filename): with open(filename, encoding='utf-8', newline='') as file: return csv.reader(file) ``` -* **If `'newline=""'` is not specified, then newlines embedded inside quoted fields will not be interpreted correctly.** ### Write Rows to CSV File ```python diff --git a/index.html b/index.html index 7ac7281..f56e851 100644 --- a/index.html +++ b/index.html @@ -1481,6 +1481,9 @@ os.replace(from, to) # Encodes objects using `str(<el>)`. <writer>.writerows(<coll_of_coll>) +
    +
  • File must be open with 'newline=""' argument, or newlines embedded inside quoted fields will not be interpreted correctly!
  • +

Parameters

  • 'dialect' - Master parameter that sets the default values.
  • @@ -1510,9 +1513,6 @@ os.replace(from, to) with open(filename, encoding='utf-8', newline='') as file: return csv.reader(file) -
      -
    • If 'newline=""' is not specified, then newlines embedded inside quoted fields will not be interpreted correctly.
    • -

    Write Rows to CSV File

    def write_to_csv_file(filename, rows):
         with open(filename, 'w', encoding='utf-8', newline='') as file: