import threading import time import requests from threading import current_thread
def autocheck(): while True: bktels = [] thread_list = [] bktels = ['ID1','ID2','ID3','ID4','ID5','ID6','ID7','ID8','ID9','ID10'] for n in bktels: th = threading.Thread(target=getPID, args=(n,)) thread_list.append(th) for t in thread_list: t.start() for t in thread_list: t.join() time.sleep(50)
def getPID(n): threada = threading.current_thread() str2 = ','.join('%s' %id for id in n) print (threada.getName() +' ID:'+str2) url = 'http://127.0.0.1/login.php?id=' + str2 html=requests.get(url) print html.text