file_spellcheck = input("Name of the document to be spell-checked:  ")
with open(file_spellcheck, "r") as i:
    spellchecking = i.read()
    for item in spellchecking:
        items = item.split()
        if items in

    with open("file.out", "w") as i:
        i.write()

I need to make a spell checker that uses another file as a dictionary. So let's say the dictionary is words.dat, then the user is prompted to name a document to spell check. User enters a document to spell check, but the program should prompt the user with the word that is spelled incorrectly to either replace, replace all, ignore, ignore all or exit.
I got stuck as to where to go with the if statement.

Since in the above code the variable spellchecking is a string, item in the for loop will be a character.

You might also want to look into third party module pyenchant

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.