Python Login Verification Applet script

Source: Internet
Author: User

Python Login Verification Applet script

Flowchart of the Script program:

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/07/0D/wKiom1nCeNCAsa6IAACoBPQQFeE791.png "title=" Login program flowchart. png "width=" 660 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:660px;height:300px; "alt=" Wkiom1ncencasa6iaacobpqqfee791.png "/>

#!/usr/bin/env python# _*_ coding:utf-8 _*_# Enter the above line to recognize the Chinese character annotation ## --------------------- ----------------------------------------------------------# filename:    login.py#  revision:    1.0# date:        2017/09/ 20# author:      xad# email:        [email protected]# website:     http://onenice.blog.51cto.com/#  description: check login# notes:       ~# ------------- ------------------------------------------------------------------# copyright:   2017 (c) xad# license:     gplimport sysusername =  ' XAD ' password =   ' xad123 ' retry_counter = 0#login_status =  ' NO ' login_status =  ' YES ' # Use this to simulate whether the user is online ## login verification part  #while  retry_counter <3 : Exit #  #当retry_counter   more than 3 times  user = raw_input (' Username: '). Strip ()   if len (user)  ==0:  # Verify that the input user is empty, then continue the loop, otherwise enter the next validation input #print  "error : username cannot be empty!" Continue  passwd = raw_input (' Password: '). Strip ()   if len (passwd)  ==  0:   #验证输入密码是否为空, is to continue the cycle, otherwise jump out of the loop #print  "error : password cannot be  empty! "   continue  else:if user == username  and  passwd  == password: #验证用户密码是否都正确, it's all right to allow login! #   if login_status ==  ' YES ':       sys.exit (' Sorry ,  user %s has been logining! '  % user )    else:      sys.exit (' welcome %s  logining to system! '  % user ) else:   #retry_counter  = retry_counter + 1  retry_ counter += 1  print  ' wrong username or password, please  Verify your username or password ! \nonly %s more chances! '  %  (3 - retry_counter  )


Python Login Verification Applet script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.