python随机生成一个简单的密码代码

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

import random
import sys
 
def main(argv):
 
    if (len(sys.argv) != 2):
        sys.exit('Usage: simple_pass.py <password_length>')
     
    password = ''
    for i in range(int(argv[0])):
        password += chr(random.randint(33,126))
     
    print 'You new password is: ' + password
 
if __name__ == "__main__":
    main(sys.argv[1:])