importtimeimport pandas as pd
import mythread as mt
import get_info as gi
if __name__ == '__main__':
urlList = []
for i in range(1, 100):
urlList.append(
'https://c.y.qq.com/v8/fcg-bin/v8.fcg?channel=singer&page=list&key=all_all_all&pagesize=100&g_tk=5381&jsonpCallback=GetSingerListCallback&loginUin=0&hostUin=0&format=jsonp&inCharset=utf8&outCharset=utf-8¬ice=0&platform=yqq&needNewCode=0&pagenum=' + str(
i))
threadList = [mt.Mythread(gi.Qyinyue, (url,)) for url in urlList]
start_time = time.time()
for t in threadList:
t.setDaemon(True)
t.start()
for t in threadList:
t.join()
end_time = time.time()
df = pd.DataFrame(gi.datas, columns=['Fother_name', 'Fsinger_id', 'Fsinger_name'])
print df
print "use the time is %s s" % (end_time - start_time)
''
testmain
importtimeimport pandas as pd
import mythread as mt
import get_info as gi
if __name__ == '__main__':
urlList = []
for i in range(1, 100):
urlList.append(
'https://c.y.qq.com/v8/fcg-bin/v8.fcg?channel=singer&page=list&key=all_all_all&pagesize=100&g_tk=5381&jsonpCallback=GetSingerListCallback&loginUin=0&hostUin=0&format=jsonp&inCharset=utf8&outCharset=utf-8¬ice=0&platform=yqq&needNewCode=0&pagenum=' + str(
i))
threadList = [mt.Mythread(gi.Qyinyue, (url,)) for url in urlList]
start_time = time.time()
for t in threadList:
t.setDaemon(True)
t.start()
for t in threadList:
t.join()
end_time = time.time()
df = pd.DataFrame(gi.datas, columns=['Fother_name', 'Fsinger_id', 'Fsinger_name'])
print df
print "use the time is %s s" % (end_time - start_time)