You are on page 1of 1

1

im po rt random
3 im po rt s t r i n g
im po rt time
5
d e f mkpass ( s i z e =16) :
7 chars = [ ]
chars . extend ( [ i f o r i in s t r i n g . a s c i i l e t t e r s ] )
9 chars . extend ( [ i f o r i in s t r i n g . d i g i t s ] )
c h a r s . e x t e n d ( [ i f o r i i n ’ \ ’ ” !@#$ %&*()= =+[{}]˜ˆ , <. >;:/? ’ ] )
11
passwd = ’ ’
13
f o r i in range ( s i z e ) :
15 passwd += c h a r s [ random . r a n d i n t ( 0 , len ( chars ) = 1) ]

17 random . s e e d = i n t ( time . time ( ) )


random . s h u f f l e ( c h a r s )
19
r e t u r n passwd

You might also like