Sep-24-2018, 04:44 PM
This runs, as in it appends the file. The problem is I get this traceback error and I don't know why.
employee_file = open("Employees.txt", "a") employee_file.write("\nToby - Human resources") employee_file.write("\nKelly - Customer service") print(Employees.txt) employee_file.close()
Error:C:\Python365\python.exe F:/USERS/Tonya/Python/Draft/Writing_and_Appending_to_Files.py
Traceback (most recent call last):
File "F:/USERS/Tonya/Python/Draft/Writing_and_Appending_to_Files.py", line 8, in <module>
print(Employees.txt)
NameError: name 'Employees' is not defined
Process finished with exit code 1
As always - thank you!