About frame rate

    num = boy.getFrameNum("walk")
    print num, num/5
    
    boy.setPlayRate(5, "walk")
    boy.playAnimation("walk")    

It print likes this:
101 20

It means the total frame number is 101, and the total seconds are 20s
But when the window is appear, the animation just keeps 2s.

Why?

Why “num/5” is your animation duration? Did you model it with 5 frames per second?

boy.setPlayRate(5, "walk")

means play animation 5 times faster. It looks like the real duration of your animation is 10 seconds with around 10 frames per second.