Add progress bar

main
justuser31 2 years ago
parent 35574ef69f
commit 33c335b001

@ -3,9 +3,10 @@ from tkinter import *
####DRAW BLOCK ####DRAW BLOCK
import requests import requests
from time import sleep from time import sleep
from tqdm import tqdm
def draw(cords): def draw(cords):
for i in range(len(cords)): for i in tqdm(range(len(cords))):
sleep(0.2) sleep(0.2)
try: try:
payload = {'x': cords[i][1], 'y': cords[i][0], 'color': cords[i][2]} payload = {'x': cords[i][1], 'y': cords[i][0], 'color': cords[i][2]}
@ -13,12 +14,12 @@ def draw(cords):
payload = {'x': cords[i][1], 'y': cords[i][0], 'color': "b" } payload = {'x': cords[i][1], 'y': cords[i][0], 'color': "b" }
response = requests.post('http://pb.dmcraft.online', data=payload) response = requests.post('http://pb.dmcraft.online', data=payload)
print(response) #print(response)
while str(response) != "<Response [200]>": while str(response) != "<Response [200]>":
response = requests.post('http://pb.dmcraft.online', data=payload) response = requests.post('http://pb.dmcraft.online', data=payload)
print("Retrying...") print("Error, retrying...")
print(response) #print(response)
print("!!!DONE!!!") print("!!!DONE!!!")

Loading…
Cancel
Save