I'm trying to add the functionality of writing information from one CSV to a new CSV file if certain inputs are met. I'm struggling to get the functions that are executed to also write into the new CSV file. This is my current (very basic) function to print the information that I want to add out;
def function():
with open('my_file.csv', 'r') as csv.file:
csv_reader = csv.reader(csv.file)
next(csv_reader)
for line in csv_reader:
print(line)
Thanks in advance - my python is quite primitive!