code: def distance_to_end(file_obj):
      
      position_current = file_obj.tell()
      file_obj.seek(0, 2)
      position_end = file_obj.tell()
      file_obj.seek(position_current)
      distance = position_end - position_current
      return distance
docs: For an open file object how far is it to the end
  
      Parameters
      ----------
      file_obj: open file- like object
  
      Returns
      ----------
      distance: int, bytes to end of file