'module 'csv' has no attribute 'writerow'

Trying to write a list to a csv file using:

import csv

with open('filename.csv', 'w', newline='') as csvfile:
    wr = csv.writer(csvfile, quoting=csv.QUOTE_ALL)
    wr = csv.writerow(list)

returns the error:

module 'csv' has no attribute 'writerow'

Any help is much appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source