import csv with open('file_name.csv', mode='a', encoding='utf-8') as file: writer = csv.writer(file_name.csv) writer.writerow("This text is being written in excel file.")