尝试在python中运行文件,但出现错误

时间:2019-04-30 00:09:42

标签: python python-3.x

我正在登录以运行程序,但是当我尝试在程序末尾运行文件时,会抛出错误

while True:
        login1 = input("Login:")
        login2 = input("Password:")
        file = open(login1+".txt", "r")
        data   = file.readline()
        file.close()
        if data == login1+":"+login2:
            print("Welcome")
            exec(open(r"E:\Coding\Python AI project").read())
            break
        print("Incorrect username or password.")

我希望它运行文件,但会引发错误

Traceback (most recent call last):
  File "E:/Coding/login.py", line 27, in <module>
    exec(open(r"E:\Coding\Python AI project").read())
PermissionError: [Errno 13] Permission denied: 'E:\\Coding\\Python AI project'

0 个答案:

没有答案