def feof( fileid ):

    pos = fileid.tell()
    fileid.seek(0,2) # goto end of file
    end = fileid.tell() #get final position
    fileid.seek(pos)
    return pos == end
Reproduces the behavior of the mel command of the same name. if writing pymel scripts from scratch,
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/pymel/core/system.py/feof