code: def write_numeric(fmt, value, buff, byteorder='big'):
      
      try:
          buff.write(fmt[byteorder].pack(value))
      except KeyError as exc:
          raise ValueError('Invalid byte order') from exc
docs: Write a numeric value to a file-like object.