def is_empty(filename):
 try:
  return (os.stat(filename).st_size == 0)
 except OSError:
  return False

def is_empty ( filename ) : try : return ( os . stat ( filename ) . st_size == 0 ) except OSError : return False
is a file empty? .