import csv
      
      with open(file_name, mode ='r', encoding='utf-8') as file:
        # reading the CSV file
        csvFile = csv.DictReader(file)
        # displaying the contents of the CSV file
        for line in csvFile:
          

      Python language logo
      read csv file

      2

      315

      avatar
      juli1
      Python public recipes

      Read a CSV file in Python

      Regular read CSV file with the CSV library

      For each line, use line["attributeName"] to access the content.

      Shortcut: csv.file.read

      1 Comments

      Add Comment

      Log in to add a comment

      Codiga - All rights reserved 2022.