It's always polite to close your files, though there are so few here and this script exits so soon that it doesn't practically matter. Here's the easy way:

    with open(myfile, 'r') as file:
        op.execute(file.read())