Working on making a password manager for a school project and I'm having trouble trying to add new account information to my password_manager.csv file. The information is being pulled from the other file when entered and it's printing successfully but when I try writing it to the csv file I get errors.
import csv
def createNewAccount(appName,userEmail,userName,userPassword):
data = [appName,userEmail,userName,userPassword]
print(data)
with open('password_manager.csv','a') as csv_file:
csv_writer = csv_file.write(csv_file, delimiter = '\t')
csv_file.writerow(data)
I can' test this because you didn't say exactly what errors you are getting (which you should always do when asking questions here). That said, it looks to me like you're not using the
csv
module correctly — see thecsv.writer
documentation which contains example code.The problem I see with your code are corrected in what's below: