This is the error i get when i run my code
File "D:\talha\Documents\School\Computer\Programming\Caravan Park TKINTER\Tkinter Caravan.py", line 27, in Add_Customer
with open(userFile, 'w')as details:
PermissionError: [Errno 13] Permission denied: 'adfaadfadf.txt'
This is the code that causes the error
def Add_Customer():
nameEntry = firstName.get()
lastNameEntry = lastName.get()
EmailEntry = Email.get()
PhoneEntry = Phone.get()
userFile = nameEntry+lastNameEntry+'.txt'
with open(userFile, 'w')as details:
details.write('First Name: '+nameEntry)
details.write('Last Name: '+lastNameEntry)
details.write('Email Address: '+EmailEntry)
details.write('Phone Number: '+PhoneEntry)
details.close()
this is the line in which the error occurs
with open(userFile, 'w')as details: