#how to read specific word of file f = open("demofile.txt", "r") print(f.read(5)) 

Read more of this post