摘要: import threading,time,queueq=queue.Queue(maxsize = 10)def product(name): count = 1 while True: q.put(count) print("%s生产了%s个骨头"%(name,count)) count += 阅读全文
posted @ 2017-10-26 22:42 沧海一粒水 阅读(110) 评论(0) 推荐(0) 编辑
摘要: import threadingimport timeevent=threading.Event()def lighter(): count = 0 while True: if count < 5: event.set() print("\033[1;42m;green light is on \ 阅读全文
posted @ 2017-10-26 21:38 沧海一粒水 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 1、cat /etc/inittab 设定机器的运行级别: # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser, without NFS (The same as 3, if you d 阅读全文
posted @ 2017-10-26 20:04 沧海一粒水 阅读(501) 评论(0) 推荐(0) 编辑
摘要: 显示颜色格式:\033[显示方式;字体色;背景色m......[\033[0m] 字体色 | 背景色 | 颜色描述 30 | 40 | 黑色 31 | 41 | 红色 32 | 42 | 绿色 33 | 43 | 黃色 34 | 44 | 蓝色 35 | 45 | 紫红色 36 | 46 | 青蓝色 阅读全文
posted @ 2017-10-26 20:03 沧海一粒水 阅读(163) 评论(0) 推荐(0) 编辑
摘要: import threadingimport timedef run (n): semaphore.acquire() time.sleep(1) print("run threading :",n) semaphore.release()semaphore=threading.BoundedSem 阅读全文
posted @ 2017-10-26 16:19 沧海一粒水 阅读(166) 评论(0) 推荐(0) 编辑