This is the code i have used
iname = \"name1\" ipassword = \"password1\" iemail = \"email@domain.com\" res1 = []
Another simple approach is to use pd.Dataframe.loc method.
row = [iname, ipassword, iemail] df.loc[len(df)] = row df.to_csv("login.csv", index=False)