Text Duplicate filter in Python 3.7
You should not use global variables unless you really need to. Instead, pass relevant parameters as arguments to the functions and return the results. This makes them actually reusable. Currently you have two functions to count the initial and final number of words, when you could just have a word_count function:

def wordcount(file_name):
    """count the number of words in the file"""
    with open(file_name) as f:
        return sum(len(line.split()) for line in f) 

def dupfilter(file_initial, file_final):
    with open(file_initial) as in_file, open(file_final, "w") as out_file:
        out_file.writelines(set(in_file.readlines()))

if __name__ == '__main__':
    while True:
        file_initial = input("What is the name of the text?")
        file_final = input("How do you want to name the filtered file?")
        if file_initial and file_final and file_initial != file_final:
            break

    num_words_initial = wordcount(file_initial)
    dupfilter(file_initial, file_final)
    num_words_final = wordcount(file_final)

    print("Number of duplicates filtered:", num_words_initial - num_words_final)
    input("\nPress &lt;ENTER&gt; to quit the program.")


I also used sum with a generator expression to simplify the wordcount function, used with to ensure that files are properly closed.
In addition, I replaced the while not ready loop with a while True loop and an explicit break. This is much more common in Python, especially for user input.

Note that if file_initial and file_final != "" is only incidentally the same as if file_initial != "" and file_final != "" because non-empty strings are truthy. This is why it is also equivalent to if file_initial and file_final. But for example x and y == 3 is not the same as x == 3 and y == 3.

You also don't need to call str on things to be printed, print does that for you if necessary.



Note that using set does not guarantee the same order as the original file, for that you would want to use the itertools recipe unique_everseen:


from itertools import filterfalse

def unique_everseen(iterable, key=None):
    "List unique elements, preserving order. Remember all elements ever seen."
    # unique_everseen('AAAABBBCCDAABBB') --&gt; A B C D
    # unique_everseen('ABBCcAD', str.lower) --&gt; A B C D
    seen = set()
    seen_add = seen.add
    if key is None:
        for element in filterfalse(seen.__contains__, iterable):
            seen_add(element)
            yield element
    else:
        for element in iterable:
            k = key(element)
            if k not in seen:
                seen_add(k)
                yield element



def dupfilter(file_initial, file_final):
    with open(file_initial) as in_file, open(file_final, "w") as out_file:
        out_file.writelines(unique_everseen(in_file))