with open('readme', 'r') as file_h: # Read the only line to the end print 'file content:', file_h.readline().strip() # Will not nor re-read the line,so wlll try to read line 2 content = file_h.readline().strip() print 'from variable:', contentSo with this input:
Ek6uEmoKUAAAAAAACCTVU6bnsIAABn 123This output:
Output:file content: Ek6uEmoKUAAAAAAACCTVU6bnsIAABn
from variable: 123