python通过queue模块来提供线程间的通信机制,从而可以让线程分项数据. 个人感觉queue就是管程的概念 一个生产者消费者问题 from random import randint from threading import Thread from queue import Queue from time import sleep def writeq(queue): print('starting put queue...') queue.put('hahaha', 1) #1表示在有…
目录 头文件 string 目录部分 1.string的定义及初始化 ① 用一个字符串给另一个字符串赋值 ②用字符串常量对字符串进行赋值 ③ 用n个相同的字符对字符串赋值 2.string的运算符及比较符 3.string的一些常用函数 ① size()和length() ② at() ③ find() ⑤ append() stack 目录部分 1.stack的定义 2.常用函数 ① size() ② empty() ③ pop() 与 top() ④ push() queue 目录部分 1.…