python - NotADirectoryError: [WinError 267] The directory name is invalid: 'Directory' -
so i'm working on python project simulate systems deletes information after typing wrong passwords.
import os password = str(input("set password: ")) treisleft = 3 path = "c:\users\person\desktop\python projects\password.py" while (treisleft > 0): x = str(input("what's password? ")) if (x == password): print("access granted, welcome :d") file = open ("c:\\users\\\person\\downloads\\documents\\spanish course.txt", "r") print (file.read()) break else: print("access denied, try again") treisleft -= 1 if (treisleft == 0): print ("nice try hacker!!") os.removedirs (path)
the problem error: [winerror 267] directory name invalid:
c:\users\person\desktop\python projects\password.py
(the directory basically)
Comments
Post a Comment