python - apscheduler 为什么每次运行的线程名称都不一样?是不是会不断创建新的线程?
ringa_lee
ringa_lee 2017-04-18 09:20:46
0
1
686
import  threading
from apscheduler.scheduler import Scheduler
schedudler = Scheduler(daemonic = False)

@schedudler.cron_schedule(second='*/10', minute='*', day_of_week='0-6', hour='7-21')
def send_toeflword():
    text = 'Hello World'
    print text
    print threading.current_thread().name
schedudler.start()

打印结果:

Hello World
Thread-1
Hello World
Thread-2
Hello World
Thread-3
Hello World
Thread-4
Hello World
Thread-5
Hello World
Thread-6
Hello World
Thread-7
Hello World
Thread-8
Hello World
Thread-9
ringa_lee
ringa_lee

ringa_lee

全部回复(1)
阿神

sorry,看了下,好像前面的会自动销毁。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板