【python小程序】登陸及信息查詢系統

#!/usr/bin/env pythonpython

#FileName:dict.pyide

###################ui

# xiaoming:199199 #spa

# xiaohong:188188 #get

# xiaolan:100100  #input

###################it

import getpass class

running = Trueimport

while running:im

        dict = {

                'xiaoming':199199,

                'xiaohong':188188,

                'xiaolan':100100

                }

        a = str(raw_input('login: '))

        if a in dict.keys():

b = int(getpass.getpass('password:'))

                c = int(dict[a])

                if b == c:

               print 'Login Success!Welcome %s!' %a

break

                else:

                        print 'Sorry,Login faild!'


        else:

                print 'Please check your name!'

continue

while running:

dict1 = {

'user1':"Tel:18800000001,Address:Beijing,Email:1@qq.com",

'user2':"Tel:18800000002,Address:Shanghai,Email:2@qq.com",

'user3':"Tel:18800000003,Address:Guangzhou,Email:3@qq.com",

'user4':"Tel:18800000004,Address:Shenzhen,Email:4@qq.com"

}

Name = str(raw_input('Please enter a name,logout please enter quit: '))

if Name == str('quit'):

break

else:

if Name in dict1.keys():

words = str(dict1[Name])

print "%s's words is %s." %(Name,words)

continue

else:

print 'Please check your name!'

continue

print 'Bye Bye!!!'

相關文章
相關標籤/搜索