AndreiL
Welcome to AndreiL.
Enjoy your time.
Please log in.

Random password generator - Python

Go down

Random password generator - Python

Post by Lucaci Andrei on Mon Feb 13, 2012 3:18 am

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'''
Created on Feb 13, 2012

@author: sin
'''
import random
import string
def gen():
a = []
n = raw_input("Password lenght: ")
def add(a, n):
for i in range(0, int(n)):
m = random.choice(string.letters.lower())
a.append(m)
return str(a)
add(a, n)
random.shuffle(a)
rez = ''
for i in range(0, len(a)):
rez = rez + str(a[i])
print rez, "\n"

while True:
gen()

avatar
Lucaci Andrei
"Tata Lor"


Number of messages : 222
Points : 2266743
Reputation : 1007
Registration date : 2008-08-15
Age : 25
Location : Cluj-Napoca

View user profile http://www.andreil.wgz.ro

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum