Pygame Jump Animation Problem How To Fix?

so I am trying to make my mouse jump only one time 1 and play the animation as it jumps but I am not sure why it keeps playing the animation again and again even though I landed on the floor VIDEO << ***as you can see the image keeps repeating even though when I am not clicking space any more.

in my main loop I made it so when I click space then my direction of my mouse should be jump and then when I click jump it plays but after that it will keep playing is there a way I can actually make it look like its jumping and how do I stop the repeat of the jump

# our main loop
run = True
while run:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False


    keys = pygame.key.get_pressed()

    if playerman.direction == "right":
        playerman.direction = "Idle"

    if playerman.direction == "left":
        playerman.direction = "leftid"

     # if we click space then we should play the space jump only once but it keeps repeating?

    if keys[pygame.K_SPACE]:
        playerman.direction = "jump"
        


    # bird moving
    if not playerman.isJump:
        playerman.y += playerman.fall
        playerman.fall += 1
        playerman.isJump = False

        collide = False
        if playerman.rect.bottom >= 605:
            collide = True
            playerman.isJump = False
            playerman.JumpCount = 10
            playerman.y = 605 - playerman.height

        if collide:
            if keys[pygame.K_SPACE]:
                playerman.isJump = True

            playerman.fall = 0


    else:
        if playerman.JumpCount > 0:
            playerman.y -= (playerman.JumpCount*abs(playerman.JumpCount))*0.4
            playerman.JumpCount -= 1
        else:
            playerman.JumpCount = 10
            playerman.isJump = False



my mouse class

# our player class
class player:
    def __init__(self,x,y,height,width,color):
        self.x = x
        self.y = y
        self.height = height
        self.width = width
        self.idle = [pygame.image.load("grey_mouse/idle (" + str(i) + ").png") for i in range(1, 21)]
        self.leftid = [pygame.image.load("grey_mouse/id (" + str(i) + ").png") for i in range(1, 21)]

        self.Right = [pygame.image.load("grey_mouse/walk (" + str(i) + ").png") for i in range(1, 9)]
        self.left = [pygame.image.load("grey_mouse/left (" + str(i) + ").png") for i in range(1, 9)]
        self.jump = [pygame.image.load("grey_mouse/jump (" + str(i) + ").png") for i in range(1, 9)]

        self.color = color
        self.rect = pygame.Rect(x,y,height,width)
        self.fps = 50
        self.next_frame_time = 0
        self.clock = pygame.time.Clock()
        self.direction = "jump"

        self.direction = "Idle"
        self.direction = "right"
        self.direction = "left"
        self.direction = "leftid"

        self.speed = 3
        self.anim_index = 0
        self.fall = 0
        self.isJump = False
        self.jumpCount = 10
    def get_rect(self):
        self.rect.topleft = (self.x,self.y)
        return self.rect
         

            
    def draw(self):
        self.rect.topleft = (self.x,self.y)
        if self.direction == "Idle":
            self.clock.tick(self.fps)
            image_list = self.idle

        elif self.direction == "right":
            self.clock.tick(self.fps)
            image_list = self.Right
                
        elif self.direction == "left":
            self.clock.tick(self.fps)
            image_list = self.left

        elif self.direction == "leftid":
            self.clock.tick(self.fps)
            image_list = self.leftid

        elif self.direction == "jump":
            self.clock.tick(self.fps)
            image_list = self.jump

            
                # Is it time to show the next animation frame?
        time_now = pygame.time.get_ticks()
        if ( time_now > self.next_frame_time ):
                    # set the time for the next animation-frame
            inter_frame_delay = 1990 // self.fps   
            self.next_frame_time = time_now + inter_frame_delay  # in the future
                    # move the current image to the next (with wrap-around)
            self.anim_index += 1
            if self.anim_index >= len( image_list ):
                self.anim_index = 0
                            
        if self.anim_index >= len(image_list):
            self.anim_index = 0
        player_image = image_list[self.anim_index]

        player_image = image_list[self.anim_index]
        self.hitbox = (self.x, self.y + 30, 46,60)

        player_rect = player_image.get_rect(center = self.get_rect().center)
        player_rect.centerx += 0
        player_rect.centery += -20
        window.blit(player_image, player_rect)


Answer

When SPACE is pressed, playerman.direction is set to "jump". However, this state is not changed when the jumping is finished. Change playerman.direction when the jumping is finished:

run = True
while run:
    # [...]

    if not playerman.isJump:
        # [...]

    else:
        if playerman.JumpCount > 0:
            playerman.y -= (playerman.JumpCount*abs(playerman.JumpCount))*0.4
            playerman.JumpCount -= 1
        else:
            playerman.JumpCount = 10
            playerman.isJump = False
   
            # change animation
            if playerman.direction == "jump":
                playerman.direction = "Idle"