更改相同或其他脚本的代码行

时间:2017-05-13 23:32:23

标签: python passwords

我有两个.py脚本,我想从主脚本编辑存储密码的脚本。这是带密码的脚本:

    import getpass, os
    def log_in():
        Username = "username"
        Password = "password"
        getUsername = input("Username:")
        while getUsername != Username:
            print("Wrong username")
            getUsername = input("Username:")
        x = 0
        while x < 5:
            getPass = getpass.getpass("Password:")
            if getPass != Password:
                print("Password is invalid")
                x = x + 1
            else:
                print("Welcome back sir\n")
                x = 10

所以如果我想让用户通过他们的输入更改密码但是可能,如果是,那怎么办?

0 个答案:

没有答案