python-简单的用户与密码登录模块实现
2017-05-20 11:36
351 查看
python-简单的用户与密码登录模块实现
第一种方式:
root@kali:~# cat if.py
#!/usr/bin/python
# --*-- coding:utf-8 --*--
#input = raw_input('please input your name:')
while True:
input = raw_input('please input your name:')
if input == 'xwb':
password = raw_input('\nplease input your password:')
p = '123'
if password == p:
print 'welcome login to ddbill.com!\n'
break
else:
print '\nplease input password again!\n'
password = raw_input('\nplease input your password:')
while True:
print '\nplease input password again!\n'
password = raw_input('\nplease input your password:')
if password == p:
print 'welcome login to ddbill.com!\n'
break
break
else: print 'sorry user %s not found'% input
root@kali:~#
第二种方式:
root@kali:~# cat while.py
#!/usr/bin/python
while True:
input = raw_input('please nput your username:')
if input == 'xwb':
password = raw_input('please input your password:')
p = '123'
while password != p:
password = raw_input('wrong password,input again:')
else:
print 'weicome login to ddbill.com'
break
else:
print 'sorry, username %s not found' % input
root@kali:~#
第三种方式:
root@kali:~# cat while2.py
#!/usr/bin/python
while True:
input = raw_input('username:')
if input =='xwb':
pw = raw_input('yur pssword:')
while pw != '123':
print 'wrong password try again'
pw = raw_input('your password:')
print 'welcome to ddbill.com!'
break
else:
print 'sorry,user %s no found ' % input
root@kali:~#
第一种方式:
root@kali:~# cat if.py
#!/usr/bin/python
# --*-- coding:utf-8 --*--
#input = raw_input('please input your name:')
while True:
input = raw_input('please input your name:')
if input == 'xwb':
password = raw_input('\nplease input your password:')
p = '123'
if password == p:
print 'welcome login to ddbill.com!\n'
break
else:
print '\nplease input password again!\n'
password = raw_input('\nplease input your password:')
while True:
print '\nplease input password again!\n'
password = raw_input('\nplease input your password:')
if password == p:
print 'welcome login to ddbill.com!\n'
break
break
else: print 'sorry user %s not found'% input
root@kali:~#
第二种方式:
root@kali:~# cat while.py
#!/usr/bin/python
while True:
input = raw_input('please nput your username:')
if input == 'xwb':
password = raw_input('please input your password:')
p = '123'
while password != p:
password = raw_input('wrong password,input again:')
else:
print 'weicome login to ddbill.com'
break
else:
print 'sorry, username %s not found' % input
root@kali:~#
第三种方式:
root@kali:~# cat while2.py
#!/usr/bin/python
while True:
input = raw_input('username:')
if input =='xwb':
pw = raw_input('yur pssword:')
while pw != '123':
print 'wrong password try again'
pw = raw_input('your password:')
print 'welcome to ddbill.com!'
break
else:
print 'sorry,user %s no found ' % input
root@kali:~#
相关文章推荐
- python实现简单的用户密码登录控制(输入三次就锁定用户)
- python实现简单的用户密码登录控制(输入三次就锁定用户)
- servlet实现简单的用户密码登录
- python实现用户登录功能模块
- java_web 记录用户自动登录用户密码 模块的实现
- 用python的wxpython模块实现一个简单的与用户可以交互计算器
- python实现的简单用户注册登录系统
- 通过传用户和密码实现最简单的单点登录
- python简单实现用户表单登录
- [置顶] Java+Eclipse+Maven+struts2从MySQL数据库中查询用户密码实现简单的登录验证
- 学习python——python实现简单的用户登录
- django 1.11.5与python3.62实现简单的 注册,登录与修改密码
- Python实现简单的用户登录
- JSP+JDBC实现简单用户登录模块【Deprecated】
- Python 实现简单的用户注册和登录
- 简单设计实现基于Forms认证的注册登录等用户基础服务
- struts2实现登录用户的简单的权限设置
- Web应用中防止用户重复登录的简单实现方法
- Windows XP 如何修改实现不输入用户密码而直接登录系统
- 如何实现共享软件网络授权认证,包括注册新用户、登录、修改密码等操作