keyword 的帮助文档 >>> import keyword >>> help(keyword) Help on module keyword: NAME keyword - Keywords (from "graminit.c") DESCRIPTION This file is automatically generated; please don't muck it up! To update the symbols in this fil
先看一个很简单的例子 #coding:utf8 import Queue #queue是队列的意思 q=Queue.Queue(maxsize=10) #创建一个queue对象 for i in range(9): q.put(i) #放入元素 while not q.empty():#检测元素是否为空 print q.get(),#读取元素 #默认为先进先出 如果需要一个无限长或者先进后出的队列 #创建一个无限长的队列,如果maxsize小于1就表示队列长度无限. q1=Queue.Queue