SWIG and Automated C/C++ Scripting Extensions

By David Beazley

Dr. Dobb's Journal February 1998

>>> s = Stack()
>>> s.push("Dave")
>>> s.push("Mark")
>>> s.push("Kevin")
>>> s.pop()
'Kevin'
>>> s.depth()
2
>>> del s

Example 9: Interactive Python session using a Python container class.

Back to Article


Copyright © 1998, Dr. Dobb's Journal