def _send_str(self, cmd, args):
        """
        Format:
            {Command}{args length(little endian)}{str}
        Length:
            {4}{4}{str length}
        """
        logger.debug("{} {}".format(cmd, args))
        args = args.encode('utf-8')

        le_args_len = self._little_endian(len(args))
        data = cmd.encode() + le_args_len + args
        logger.debug("Send string: {}".format(data))
        self.connection.write(data)
def _send_str ( self , cmd , args ) : logger . debug ( "{} {}" . format ( cmd , args ) ) args = args . encode ( 'utf-8' ) le_args_len = self . _little_endian ( len ( args ) ) data = cmd . encode ( ) + le_args_len + args logger . debug ( "Send string: {}" . format ( data ) ) self . connection . write ( data )
Format:
            {Command}{args length(little endian)}{str}
        Length:
            {4}{4}{str length}