#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2010 Doug Hellmann. All rights reserved. # """LIFO Queue """ #end_pymotw_header import Queue q = Queue.LifoQueue() for i in range(5): q.put(i) while not q.empty(): print q.get()