with open("filename.txt","r") as f:     contents = f.read()

Read more of this post