创建线程两种方式
第一种,导入improt thread 模块,thread.start_new_thread(功能函数名称,(参数1,参数2...)) 后面参数为功能函数的参数
第二个方式类似于java,导入threading模块,继承threading.Thread类,重写__init__和run方法。start启动线程
GUI功能需要安装Tkinter
线程同步利用lock, Rlock,acquire,release等方法
本文共 266 字,大约阅读时间需要 1 分钟。
创建线程两种方式
第一种,导入improt thread 模块,thread.start_new_thread(功能函数名称,(参数1,参数2...)) 后面参数为功能函数的参数
第二个方式类似于java,导入threading模块,继承threading.Thread类,重写__init__和run方法。start启动线程
GUI功能需要安装Tkinter
线程同步利用lock, Rlock,acquire,release等方法
转载于:https://my.oschina.net/hanruikai/blog/341974