未登录不匹配

2024-06-02 19:48:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我也在尝试自学Python,目前正在制作一个本地登录程序,它还没有完成,并计划随着我学习新技能而升级/改进。但是现在我遇到了一个意外错误,有人能给我解释一下怎么解决吗?因为谷歌没有给我答案。你知道吗

import time
import hashlib
import sys

print("Welcome to SYS Secure Login")
time.sleep(1)
print("Please put ID against the blue wall")
time.sleep(2)
print("\nUser ID detected, continuing sequence")
time.sleep(3)
print("\n\n...Loading...")
time.sleep(2)

name = input('\nEnter username: ');
if name == 'Bradley':
    pwd = input('Enter password: ')
    if pwd == '1234':
                print("\nWelcome," , name, "")
                time.sleep(2)
                command = input("\nEnter Command: "); #only valid commands work, any other commands loop back to this statement

####                                                           upload command                

                if command == ('upload backdoor.jar'):
                    print("\n\n...Loading")
                    time.sleep(2)
                    print("\n\n.backdoor.jar uploading")
                    time.sleep(4)
                    print("\n\n.backdoor.jar upload complete")

####                                                           add user command

                if command == ('add_newuser'): #adds new user to local logon
                    print("\nAdding new user, please insert permision rank ")

                    rank = input('\Rank Permision is: ');
                    if rank == 'guest':
                        print("Guest account created")
                    elif rank == 'admin':
                        print("admin account created")
                    elif print("Unknown paramiters"):

####                                                            unknown command

            **if not command ##ERROR HERE**
            print("\n\nInvalid Command, please try again")

else: #For username, to 'fool' any person with unknown username 
    input("Enter password: ")
    print("\n\nInvalid username or password, program closing")
    exit()



input("\n\nPress the enter key to exit.")

Tags: tonameimportinputiftimeusernamesleep