: Sturla Molden;sturla.mol...@gmail.com;
发送时间: 2014年7月26日(星期六) 凌晨4:04
收件人: python-listpython-list@python.org;
主题: Re: problem on multi-threading
水静流深 1248283...@qq.com wrote:
name=['60', '01', '600319', '600531','600661', '600983', '600202',
'600149']
x=webdata(name)
x.run()
never
On Fri, Jul 25, 2014 at 12:45 AM, 水静流深 1248283...@qq.com wrote:
never quit from the thread ,why?
I am going to guess that you can actually run code in the interpreter
here. When printing from threads, the prompt will end up in the wrong place
as the prompt is printed in the main thread.
The right program is as following,everything is ok.
import requests
import threading
import queue
class webdata(object):
def __init__(self,name):
self.jobs=queue.Queue()
for x in name:
url='http://stockhtm.finance.qq.com/sstock/ggcx/%s.shtml' %x
水静流深 1248283...@qq.com wrote:
name=['60', '01', '600319', '600531','600661', '600983', '600202',
'600149']
x=webdata(name)
x.run()
never quit from the thread ,why?
Call .start() instead of .run()
--
https://mail.python.org/mailman/listinfo/python-list