I have been searching a lot, and I cannot find whats wrong with my code. Its a proxy checker, and I have made a for loop with threading, and want it to print "FINISHED" after finishing the loop:
def cthread():
while len(proxies) > 0:
proxy = proxies.pop(0)
try:
requests.get(url, proxies={'https':proxytype+"://"+proxy}, timeout=timeout)
print(proxy, '< GOOD PROXY')
with open('working.txt', 'a') as proxywork:
proxywork.write(proxy + '\n')
proxywork.flush()
except:
try:
print(proxy, ' > BAD')
except:
print("ERROR")
for i in range(tc):
threading.Thread(target=cthread).start()
configuration.close()
print("FINISHED")
time.sleep(900.0 - ((time.time() - starttime) % 900.0))
but it prints "FINISHED" before even checking a half of the proxies, and I want it to do so after finishing the for loop.
Thanks for helping :)