Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #############################
- # Project Aluf
- # Jp ~2013 - Number Dictionary Creator
- #############################
- #IMPORTS
- #json- for files
- import json
- #class create numbers
- class CreateNumberList:
- #max number
- maxnum=1000000
- #min number
- minnum=0
- #make empty list
- numbers=[]
- #globals
- global minnum,maxnum,numbers
- #create a file if none##################
- f = open("numbers.txt", "w")
- f.close
- ########################################
- #openfile and read possible password list
- f = open("numbers.txt", "r")
- #print to console on loading of file
- print("[INF]Loading Passwords DNumbers database...")
- #for each line in file , reallines
- for name in f.readlines():
- #test if line is there
- if len(name.strip())>0:
- #append name to list, strip away whitespace
- numbers.append(name.strip())
- #close when for loop runs out of lines
- f.close()
- # END #
- #MAIN - STARTING POINT
- def __init__(self):
- #Use methods
- self.CreateNumber(minnum,maxnum)
- self.Save()
- #######################
- #Funtions
- #######################
- #define save function
- def Save(self):
- #save
- print("[SAV] Saving Password in hacked.txt")
- #open file , w = write ,set f = open file
- f = open("numbers.txt", "w")
- #write to file
- f.write("\n".join(numbers))
- #close file
- f.close()
- #create the number list
- def CreateNumber(self,_minnum,_maxnum):
- #make counter out of loop
- counter=0
- #print
- print("Starting loop....")
- #loop through the range from 1 - 100 and each loop , set current number as var num
- for num in range(_minnum,_maxnum):
- #set the created number to var. num(loops),add current number of loop to list
- numbers.append(str(num))
- #increase int counter
- counter+=1
- #check if number 100000 is reached
- if counter > 100:
- #if so, Save
- self.Save()
- #set counter back to 0
- counter=0
- #print
- print(str(num)+" - Created and .append() to list : Success...")
- #print end
- print("Success "+str(_maxnum)+" number list created and saved in numbers.txt")
- #make object to start
- startobj=CreateNumberList()
Advertisement
Add Comment
Please, Sign In to add comment