Last active
November 7, 2017 14:24
-
-
Save Lh4cKg/20a5b947e5f2b9c4818e to your computer and use it in GitHub Desktop.
python3 wordlist generator, womlg.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on 06 Nov 2013 | |
@author: Lasha Gogua | |
""" | |
import os | |
from itertools import product | |
# colors | |
R = '\033[31m' | |
G = '\033[32m' | |
B = '\033[34m' | |
w = 'WordList Generator' | |
geo_hats = """%s | |
_____ __ __ __ | |
/ ___/__ ___ / // /__ _/ /____ | |
/ (_ / -_) _ \/ _ / _ `/ __(_-< | |
\___/\__/\___/_//_/\_,_/\__/___/ | |
%s %s | |
""" % (B, G, w) | |
print(geo_hats) | |
def generate_word_list(path=None): | |
""" | |
word list generator | |
:param path: file path | |
:return | |
""" | |
if path: | |
file = path | |
else: | |
file = input(" ფაილის სახელი: ") | |
# if not os.path.isfile(file): | |
# pass | |
print('\n') | |
enter_text = input(""" შეიტანეთ | |
.) სიტყვები | |
.) რიცხვები | |
.) სიმბოლოები | |
> """ + R) | |
word_min = int(input(G + " სიტყვის მინიმალური სიგრძე > " + R)) | |
word_max = int(input(G + " სიტყვის მაქსიმალური სიგრძე > " + R)) | |
with open(str(file), 'w+') as f: | |
[[f.writelines("".join(word_comb) + "\n") for word_comb in product(str(enter_text), repeat=n)] | |
for n in range(word_min, word_max + 1)] | |
f.close() | |
line_count = open(file, "rb").readlines().__len__() | |
file_size = round(os.path.getsize(file) / 1024 ** 2, 2) | |
print(B + """ | |
# # # # # # # # | |
* შ ე დ ე გ ი * | |
# # # # # # # # | |
""") | |
print(R + " სულ შეადგინა " + G + str(line_count) + R, "ხაზი") | |
print(" ფაილის ზომა : " + G + str(file_size) + R, "მეგაბაიტი") | |
return True | |
if __name__ == "__main__": | |
generate_word_list() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment