I am trying to write a function that takes in a list of strings and writes each String in the list as a separate row in a csv file, but I am not getting any output. Could yo
Why don't you try doing it with pandas instead. It's super easy. :)
lst = ['name@domain.com', 'name@domain.com', 'name@domain.com', 'name@domain.com', 'name@domain.com', 'name@domain.com']
First, import package
import pandas
Then, create dataframe
df = pandas.DataFrame(data={"email": lst})
Then, export to csv :)
df.to_csv("./mycsv.csv", sep=',',index=False)
Done :) let me know if this one works for you!