Ejemplo n.º 1
0
 def get_stock_patch(self):
     print('get_stock_patch')
     self.raw_data = ''
     tp = ThreadPool(10)
     path = 'http://hq.sinajs.cn/list='
     str = ''
     c = 0
     for i in self.get_stock_names():
         c = c + 1
         str += i
         str += ','
         if c < 200:
             continue
         tp.add_worker(self.thread_task, path + str, self.thread_task_cb)
         str = ''
         c = 0
     if len(str) > 0:
         tp.add_worker(self.thread_task, path + str, self.thread_task_cb)
     tp.pool_start()
     tp.pool_join()
     print('get_stock_patch_done')
     return self.raw_data
Ejemplo n.º 2
0
 def get_stock_patch(self):
     print('get_stock_patch')
     self.raw_data = ''
     tp = ThreadPool(10)
     path = 'http://hq.sinajs.cn/list='
     str = ''
     c = 0
     for i in self.get_stock_names():
         c = c + 1
         str += i
         str += ','
         if c < 200:
             continue
         tp.add_worker(self.thread_task, path + str, self.thread_task_cb)
         str = ''
         c = 0
     if len(str) > 0:
         tp.add_worker(self.thread_task, path + str, self.thread_task_cb)
     tp.pool_start()
     tp.pool_join()
     print('get_stock_patch_done')
     return self.raw_data