Answers for "python console animation"

0

python console animation

import time
# bar is the var that loops
bar = [
    " [=     ]",
    " [ =    ]",
    " [  =   ]",
    " [   =  ]",
    " [    = ]",
    " [     =]",
    " [    = ]",
    " [   =  ]",
    " [  =   ]",
    " [ =    ]",
]
i = 0

while thing_isnt_completed: # change loop if necessary
    print(bar[i % len(bar)], end="\r")
    time.sleep(.2) # time per frame
    i += 1
Posted by: Guest on May-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language