code: def pack(self, value=None):
          
          if isinstance(value, type(self)):
              return value.pack()
  
          try:
              if value is None:
                  value = self.value
              packed = struct.pack(self._fmt, bytes(value, 'ascii'))
              return packed[:-1] + b'\0'  # null-terminated
          except struct.error as err:
              msg = "Char Pack error. "
              msg += "Class: {}, struct error: {} ".format(type(value).__name__,
                                                           err)
              raise exceptions.PackException(msg)
docs: Pack the value as a binary representation.
  
          Returns:
              bytes: The binary representation.
  
          Raises:
              struct.error: If the value does not fit the binary format.