(self, cmd, args="")
Send a command to the server.
Send a command to the server.
Send a command to the server .
def putcmd(self, cmd, args=""):
        """Send a command to the server."""
        if args == "":
            s = cmd
        else:
            s = f'{cmd} {args}'
        if '\r' in s or '\n' in s:
            s = s.replace('\n', '\\n').replace('\r', '\\r')
            raise ValueError(
                f'command and arguments contain prohibited newline characters: {s}'
            )
        self.send(f'{s}{CRLF}')
def putcmd ( self , cmd , args = "" ) : if args == "" : s = cmd else : s = f'{cmd} {args}' if '\r' in s or '\n' in s : s = s . replace ( '\n' , '\\n' ) . replace ( '\r' , '\\r' ) raise ValueError ( f'command and arguments contain prohibited newline characters: {s}' ) self . send ( f'{s}{CRLF}' )