Como abrir um ficheiro com a instrução open with

estou a ver como fazer a entrada e saída de ficheiros em Python. Eu escrevi o seguinte código para ler ... check against text = input('Please enter the name of a great person: ') letsgo = filter(text,'Spanish', 'Spanish2')