コード例 #1
0
            server_utiles.ping(cs)

        elif command == "GET":
            try:
                response = list_sequences[int(argument)] + "\n"
                cs.send(response.encode())
            except IndexError:
                response = "The number you have introduced is out of range\n"
                cs.send(response.encode())
            except ValueError:
                response = "The sequence introduces must be a number\n"
                cs.send(response.encode())

        elif command == "INFO":
            s = Seq(argument)
            if s.create_dict() == True:
                response = "THE SEQUENCE SELECTED IS WRONG\n"
                cs.send(response.encode())
            else:
                response = str(s.len()) + "\n" + str(s.count_bases()) + "\n"
                cs.send(response.encode())

        elif command == "COMP":
            s = Seq(argument)
            try:
                response = str(s.seq_complement()) + "\n"
                cs.send(response.encode())
            except ValueError:
                pass

        elif command == "REV":