A Bee Movie Knock-off
For the part where you first read the file, you could write it like this:
import collections
import re

file = open('bee_movie.txt', 'r')

text = &quot;&quot;
words = collections.Counter()
punctuation = '1234567890!@#$%^&amp;*()_-+=-/*{}[];:\'&quot;\\&lt;&gt;~`|?'
all_upper = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;
all_lower = &quot;abcdefghijklmnopqrstuvwxyz&quot;
translation = str.maketrans(all_upper, all_lower, punctuation)

for line in file:
    text += line # concatenating like this is optimized in python 3
    words.update(line.translate(translation).split())

print(sum(words.values()))
print(len(words))
file.close()

For the part where you’re replacing words, it would be faster if you used re.sub. When you use text.replace, it needs to remake the entire script every time it’s used.
Also you should save the text files as .txt files, they don’t need the .py extension.
Btw you can import string and use string.ascii_uppercase, string.ascii_lowercase, and string.punctuation if you don’t want to type out all the characters.