Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Traceback error
#1
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!
Reply


Messages In This Thread
Traceback error - by tjnichols - Sep-24-2018, 04:44 PM
RE: Traceback error - by wavic - Sep-24-2018, 05:26 PM
RE: Traceback error - by tjnichols - Sep-24-2018, 07:18 PM
RE: Traceback error - by wavic - Sep-25-2018, 07:24 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Traceback error tjnichols 8 4,141 Sep-26-2018, 08:14 PM
Last Post: ThiefOfTime

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020