usr bin env python chmod to it and run file py The passgen by xN -----

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#! /usr/bin/env python
########################################
# chmod a+x to it and run "./file.py" #
########################################
# The passgen by xN #
########----------2008----------########
########################################
import random,os.path
from sys import argv
cd=os.curdir
def gen(numz=1):
a=0
ass=[]
b=[]
stringg ='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456_'
lss=list(stringg)#list of simz
while a<>numz:
ass.append('')
#--------------------set symz-
d=0
while d<>7:
b.append(random.choice(lss))
d+=1
#--------------------rand-
i=1
while i<>8:
gag=random.randint(0,7)
ass[a]+=b[gag]
i+=1
a+=1
return(ass)
#----------------------------begin-
if (len(argv)==0):
print """
##############################################
#use pg[ver].py file(or 'NO') num_of_pass #
# -by xN #
##############################################
"""
if (len(argv)<=1):
ass=gen()
ass=ass[0]
else:
ass=gen(int(argv[2]))
ass='\n'.join(ass)
#--------------------------------fw-
if (len(argv)>0):
if (argv[1]<>'NO'):
fn=argv[1]#file to w
if (os.path.isabs(fn)==True):
if (os.path.exists(fn)==True):
fw=open(fn,"w")
fw.writelines(asa)
else:
print "!!FILE DOES NOT EXISTS!!"
else:
if (os.path.exists(fn)==True):
fw=open(fn,"w")
fw.writelines(asa)
else:
print(asa)
fw.close() #the end.