Python threading多线程编程实例
Python 的多线程有两种实现方法: 函数,线程类 1.函数 调用 thread 模块中的 start_new_thread() 函数来创建线程,以线程函数的形式告诉线程该做什么 复制代码 代码如下: # -*- coding: utf-8 -*- import thread def f(name): #定义线程函数 print “this is ” + name if __name__ == ‘__main__’: thread.start_new_thread(f, (“thread1”,)) #用start_new_thread()调用线程函数和其他参数 whi
下载地址
用户评论