import csv file_path = "exemple.csv" # file_path = "/var/snap/rexroth-automationcore/common/solutions/activeConfiguration/scripts/exemple.csv" data = [ ['Name', 'Surname', 'Age'], ['john', 'toto3', 30], ['dwayn ', 'johnson', 25], ['cena', 'john', 40] ] with open(file_path, 'w') as file: writer = csv.writer(file) writer.writerows(data) print("end")