摘要: 1 import queue 2 q = queue.Queue() #模拟队列,先进先出 3 q.put('first') 4 q.put('second') 5 q.put('third') 6 7 print(q.get()) 8 print(q.get()) 9 print(q.get()) 阅读全文
posted @ 2017-08-30 15:15 一石数字欠我15w!!! 阅读(324) 评论(0) 推荐(0)
摘要: 这个模块是我遇到的最简单的了。。。。。。。。。。。 阅读全文
posted @ 2017-08-30 15:00 一石数字欠我15w!!! 阅读(306) 评论(0) 推荐(0)
摘要: from threading import Thread,Event,currentThread import time e = Event() def conn_mysql(): count = 1 while e.is_set(): #没收到信号执行 if count>3: #超过三次,弹出错误 raise Connectio... 阅读全文
posted @ 2017-08-30 14:58 一石数字欠我15w!!! 阅读(307) 评论(0) 推荐(0)
摘要: 死锁↑ 递归锁↓ 阅读全文
posted @ 2017-08-30 14:56 一石数字欠我15w!!! 阅读(380) 评论(0) 推荐(0)
摘要: 1 from multiprocessing import Process 2 from threading import Thread 3 import threading 4 import os,time 5 def work(): 6 time.sleep(2) 7 print(' >') 8 阅读全文
posted @ 2017-08-30 14:53 一石数字欠我15w!!! 阅读(426) 评论(0) 推荐(0)