Most games use images (for example .png) to create animation frame by frame.
Often all frames are in the one file like this: http://www.ucigame.org/Gallery/images/char9.png
You (as game developer) have to draw appropriate frame every 1/25 second (to get 25 FPS).
Game libraries (like PyGame) are there to help you with that – mostly they use objects called “Sprite”.
solved What type of animation file should I add to a pygame game? [closed]