Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 16 lines (13 sloc) 0.433 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
"""
Generate a random password.
Code from http://code.activestate.com/recipes/59873-random-password-generation/
"""

from random import choice
import string

def GenPasswd():
    chars = string.letters + string.digits
    for i in range(8):
        newpasswd = newpasswd + choice(chars)
    return newpasswd

def GenPasswd2(length=8, chars=string.letters + string.digits):
    return ''.join([choice(chars) for i in range(length)])
Something went wrong with that request. Please try again.