I am writing a simple script with Python3.6 and am using the csv module to create a csv file. My code is attached below, and is a carbon copy of multiple examples I have found online, but when I run the code, I get the error message TypeError: a bytes-like object is required, not a 'str'.
import csv
File_Name = Test.csv
with open(File_Name, 'wb') as csvfile:
filewriter = csv.writer(csvfile,delimiter=',')
filewriter = writerow(['Paul','Mary'])
with open(File_Name, 'w') as csvfilewriterowcome from? You are overridingfilewriteropen(open(File_Name, 'w', newline='') as csvfile:as shown in the examples in the documentation.. You also need to usefilewriter.writerow(['Paul','Mary']).