def last_bytes(file_like_object, num):
 try:
  file_like_object.seek((- num), os.SEEK_END)
 except IOError as e:
  if (e.errno == 22):
   file_like_object.seek(0, os.SEEK_SET)
  else:
   raise
 remaining = file_like_object.tell()
 return (file_like_object.read(), remaining)

def last_bytes ( file_like_object , num ) : try : file_like_object . seek ( ( - num ) , os . SEEK_END ) except IOError as e : if ( e . errno == 22 ) : file_like_object . seek ( 0 , os . SEEK_SET ) else : raise remaining = file_like_object . tell ( ) return ( file_like_object . read ( ) , remaining )
return num bytes from the end of the file .