Python_プローブ:ログインインタフェースの作成


#      
       
           
       
_author_="baihaoxiang"
import  json
# #      
#        
#            
#        
#
#   1:         1 dataUser
#                    2,data.text
#                
#             
#          2
#       1      
#       {
#            print(“          ”),      
#       }
#       }
#       2     ,value==3
#       {
#            print(        ,      )
#       }
#       3     ,value<3
#       {
#                 
#                    
#                       data.text  +1
#
#       }

#        

f_password=open("data.text",'r')
flag=json.loads(f_password.read())
#print(flag["baihaoxiang"])
f_key=open("DataUser",'r')
data=json.loads(f_key.read())
#rint(data["baihaoxiang"])
f_password.close()
f_key.close()

#    
while True:
    username=input("      ")
    userpassword=input("       ")
    for name,it in data.items():
        if username == name:
            if it<3:
                if flag[username]==userpassword:
                    print("    ")
                    break;
                else:
                    print("             ")
                    data[username]=data[username]+1;
                    #f_password=open("data.txt",'w')
                    f=open("DataUser",'w')
                    #f_password.write(json.dumps(flag))
                    f.write(json.dumps(data))
                    f.close()
            else:
                print("    ,    ")
                exit()