I have a problem with creating a .csv file that takes data from multiple lists. Those lists are created from another files, where I search for items that are meaningful for me, i.e. file name
, function name
etc. My code should is executed in a loop for all files in a work folder:
def save_to_csv_file():
rows = zip(list_name, list_func_name, list_func_return_type_combined, list_func_arg_combined, list_func_object_type)
with open(current_directory + r"\Zadanie\test_csv_2.csv", "w+") as f:
writer = csv.writer(f, delimiter=";")
writer.writerow(header_list)
for row in rows:
writer.writerow(row)
This code creates a .csv file like this:
But after saving data from file Acc.d_prec it overwrites it in second passing of the loop with data from file Adc_Irq.d_prec. And my desired output should look like this:
What changes should I make to achive that?