
import random

import chardet

zettabyte = 10**23

def get_english_words():
    return get_word_list_from_file(
        "english_words.txt" )

def get_spanish_words():
    return get_word_list_from_file(
        "espanol.txt", encoding='ISO-8859-1')


def get_common_english_words():
    return get_word_list_from_file(
        "common_english_words.txt" )


        
def get_word_list_from_file(filename, encoding='utf-8'):
    f = open( filename, encoding=encoding)
    words = f.readlines()
    words = [word[:-1] for word in words]
    f.close()
    return words


WORDS = get_common_english_words()
#WORDS = get_spanish_words()

n_words = len(WORDS)
n_pick = 7
combs  = n_words**n_pick


print("Selecting", n_pick, "words randomly from", n_words)
print( "Total combinations =", combs )
print( "     in Zettabytes =", combs/zettabyte)

for i in range(7):
    rn = random.randint( 0, n_words - 1)
    print(WORDS[rn])




