Python Password generator

Source: Internet
Author: User

Password generator: Password format: password + space + character (randomly generated custom length) 10.1.1.1 %v! z{#2) 9g,-10.1.1.2 xwig;9zidn?} 10.1.1.3 ) [Email protected]10.1.1.4 sx<_? z.<yd9&10.1.1.5 y{zy[ym6z.,o10.1.1.6 [qbxibt37rcu10.1.1.7 ) Xs7t6[^NlDP10.1.1.8  h4cwo!! w8faz10.1.1.9 #; Vxi4lgawix10.1.1.10 e+6vm&kteb| " Write it directly into the file, open it can be used, a whole line is a password! To facilitate the initial deployment of salt batch generation SALT-SSH roster files when using # /usr/bin/env python# __*__coding:utf8__*__import  Stringimport randomclass password (object):     def __init__ (self,len,  Fname_iplist, fname_password):         self.len = len         self.fname_iplist = fname_iplist         self.fname_password = fname_password    def  Createpassword (self):        iplist = []         password = []        letters =  string.digits + string.ascii_letters +  ' [email protected]#$%^&* () _+-=|} {[]; ", <>.? /'         file = open (self.fname_iplist,  ' R ')          for ip in file.readlines ():             iplist.append (ip.replace (' \ n ',    ')          file.close ()         for ip  in iplist:            # print  ip            password.append (IP)              for i in range (Self.len):     &nBsp;           password.append (Random.choice (Letters))             password.append (' \ n ')          # print password         password_list =  '. Join (password). Split (' \ n ')         #  Print password_list        file = open (self.fname_ password,  ' wb+ ')         for line in password_list:             print line             file.write (line +  ' \ n ')          file.close ()     def displaypassword (self):        &nBsp;file = open (self.fname_password,  ' R ')         for  line in file.readlines ():             print line        file.close () if __name__ ==   "__main__":     len = int (raw_input (' Input password length: ')      fname_iplist =  '/home/wangpengtai/desktop/iplist.txt '     fname_password =   '/home/wangpengtai/desktop/password.txt '     p = password (len, fname_ Iplist, fname_password)     p.createpassword ()     p. Displaypassword ()

This article is from the "LINUX" blog, so be sure to keep this source http://wangpengtai.blog.51cto.com/3882831/1943714

Python Password generator

Related Article

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.