您如何隐藏我为GCSE执行的输入代码?我已经看过getpass,当我尝试它时不起作用

时间:2019-09-05 08:34:44

标签: python

我正在为我的项目创建一个授权代码,当每个玩家输入代码时,我都找不到隐藏它的方法。我并没有真正尝试找到方法,但是我查看了stackoverflow却找不到它。我会向您展示我正在使用的代码,因为这可能会对您有所帮助。

def playerone():
    global authorityone 
    authorityone = input("Player 1 what is the authorisation code to enter the game.\n")

    if authorityone == "3004":
        global usernameone
        usernameone = input("What is your username going to be.\n")#this allows the user to input there own unique name to be saved in the leader board
        print(usernameone,"is your new username!")
        playertwo()
    else:
        mainmenu()

0 个答案:

没有答案