Writing CSV files in python
- Details
- Category: Uncategorised
- Published: Monday, 05 July 2021 12:02
- Written by Super User
- Hits: 869
see below example code.
Import csv
with open('csv_write_example_file.csv', 'w') as file:
file_writer=csv.writer(file, delimiter=',',quotechar='"')
file_writer.writerow(['Vijay s','designer', 'November'])
file_writer.writerow(['Raman','manager','march'])
Here we have imported writer object from CSV library. Opened the file in write mode. With the help of writer object we have written 2 rows of data.