Skip to content
Python Question
Profile icon
GeoneveStudios

Python Question

I have a question. In Python how do you make a loading animation.

You are viewing a single comment. View All
Profile icon
19wintersp

What kind do you want? If you want to overwrite the current line, you can use a carriage return ("\r"). The main thing is having different frames of the animation, and cycling between them:

from time import sleep frames = [".", "..", "..."] # or maybe frames = ["/", "-", "\\", "|"] for i in range(0, 10): for frame in frames: print("\r" + frame, end="") sleep(0.2)
Profile icon
GeoneveStudios

@19wintersp Thank you; but can it be more simple than that. Because I'm probably going to forget that.

Profile icon
19wintersp

@DashStudios

but can it be more simple than that

I'm really don't understand your point here. This is a bare-bones implementation of doing this.

Profile icon
GeoneveStudios

@19wintersp nevermind I get it now