I am to write a censor program for all 4 letter words from an imported file, only I'm stuck. can you help?
# wordcensor.py
# Program replaces 4 letter words in a text file.
import string
def main():
print "This program replaces 4 lettter words in a file with xxxx"
# get the sequence of words from the file
fname = raw_input("File to analyze: ")
text = open(fname,'r').read()
text = string.lower(text)
for ch in '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~':
text = string.replace(text, ch, ' ')
words = string.split(text)
wordCount = len(words)
ch = string.split(words)
charCount = len(ch)
if charCount == 4:
main()