Skip to content

Instantly share code, notes, and snippets.

@nullenc0de
Created May 28, 2023 14:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nullenc0de/22ede639ad319896bb27736b8c0377e6 to your computer and use it in GitHub Desktop.
Save nullenc0de/22ede639ad319896bb27736b8c0377e6 to your computer and use it in GitHub Desktop.
Find Best Wordlist
import os
def find_best_wordlists(user_word, max_wordlists):
wordlists_dir = '/opt/OneListForAll/dict'
wordlists = os.listdir(wordlists_dir)
matched_wordlists = []
for wordlist in wordlists:
if user_word.lower() in wordlist.lower():
matched_wordlists.append(wordlist)
matched_wordlists = sorted(matched_wordlists, key=lambda x: x.lower())
return matched_wordlists[:max_wordlists]
# Get user input
user_word = input("Enter a word: ")
# Set the maximum number of wordlists
max_wordlists = 5
# Find the best wordlists
best_wordlists = find_best_wordlists(user_word, max_wordlists)
if best_wordlists:
print(f"The top {max_wordlists} wordlists for '{user_word}' are:")
for i, wordlist in enumerate(best_wordlists):
print(f"{i+1}. {wordlist}")
else:
print("No wordlists found.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment