Can anyone tell me how can I do this?
You should try f.read(1), which is definitely correct and the right thing to do.
f.read(1)