回复: problem on multi-threading

2014-07-25 Thread 水静流深
-- 原始邮件 -- 发件人: "Sturla Molden";; 发送时间: 2014年7月26日(星期六) 凌晨4:04 收件人: "python-list"; 主题: Re: problem on multi-threading "水静流深" <1248283...@qq.com> wrote: > name=['60', '01', '600319', '6

Re: problem on multi-threading

2014-07-25 Thread Chris Kaynor
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.

Re: problem on multi-threading

2014-07-25 Thread Sturla Molden
"水静流深" <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

problem on multi-threading

2014-07-25 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 se