Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tk.Button(self, text="Начать", command=Thread(target=self.start_check).run).grid(row=4, column=1)
- self.choose_btn.grid(row=4, column=2)
- def ask_file(self):
- self.proxies_file = filedialog.askopenfile(initialdir = "/",
- title = "Выбрать файл",filetypes = (("TXT with proxies", "*.txt"),))
- self.choose_btn['text'] = "Выбрано"
- def start_check(self):
- i = 0
- proxies = self.proxies_file.read().split('\n')
- self.set_window()
- for proxy in proxies:
- print("checked")
- sleep(1)
- self.set_status(i, proxies)
- i += 1
- def set_status(self, i, all_its):
- self.status_label['text'] = "Выполняется {} из {}".format(i, len(all_its))
- def set_window(self):
- self.destroy()
- self.status_label = tk.Label(text="Выполняется...")
- self.status_label.grid(row=1, column=1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement