Python generates random passwords

Source: Internet
Author: User

Usually people generate passwords are confused, one is not enough complexity can be unsafe, enough complexity and can not manually hit the keyboard typing together characters (but usually these characters are regular), using 1password or keepass This software generation can also, But looks like 1password to charge, since so we play a fun to use Python to generate random passwords to play it;


#!/usr/bin/env python#-*-coding:utf-8-*-__author__ = ' Wz ' import stringfrom random import choice# Please set the conditions under which you want to generate a password below Passwd_ Lenth = 27passwd_count = 10passwd_seed = string.digits + string.ascii_letters + string.punctuationdef generate_passwd ():p ASSWD = []while (len (passwd)) < Passwd_lenth:passwd.append ((choice (passwd_seed))) return '. Join (passwd) if __name__ = = ' __main__ ':p rint "\ n" for I in range (0, passwd_count):p rint generate_passwd () print "\n\ngenerate Random Password done. ."


The script performs the following effects:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/58/A4/wKiom1S2OPShlFIIAAKxkn9x_K4902.jpg "title=" pa.png "alt=" Wkiom1s2opshlfiiaakxkn9x_k4902.jpg "/>

This article is from the "Linus" blog, make sure to keep this source http://wz102.blog.51cto.com/3588520/1604033

Python generates random passwords

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.