How to Check EOF in Python

Checking EOF in python is one of the trickiest parts. Since Python does not provide any such function or parameter. Simple solution is here