add spinner
This commit is contained in:
parent
a5233d3d28
commit
ca50802d3f
@ -80,6 +80,9 @@ if __name__ == "__main__":
|
||||
current_page = 0
|
||||
downloaded_counter = 0
|
||||
|
||||
spinner = ["◢◣◤◥", "◰◳◲◱", "◴◷◶◵", "◐◓◑◒", "|/-\\"]
|
||||
spinner_id = 0
|
||||
|
||||
while True:
|
||||
try:
|
||||
# Получаем адреса изображений и сортируем их в порядке возрастания
|
||||
@ -91,7 +94,17 @@ if __name__ == "__main__":
|
||||
image_download(image)
|
||||
downloaded_counter += 1
|
||||
|
||||
print("\rЗагружено {0} файлов.".format(downloaded_counter), end="")
|
||||
print(
|
||||
"\r{spinner} Загружено {total_files} файлов.".format(
|
||||
total_files=downloaded_counter, spinner=spinner[2][spinner_id]
|
||||
),
|
||||
end="",
|
||||
)
|
||||
|
||||
if spinner_id < 3:
|
||||
spinner_id += 1
|
||||
else:
|
||||
spinner_id = 0
|
||||
|
||||
current_page += 1
|
||||
except KeyboardInterrupt:
|
||||
|
Loading…
Reference in New Issue
Block a user