helpers/_examples_/ringbuffer.py

15 rivejä
452 B
Python

import sys
sys.path.append('../..')
import helpers
rb = helpers.ringbuffer(length=5)
print(rb, '\n--------------------------------------------------------------')
rb.append(0)
print(rb, '\n--------------------------------------------------------------')
rb.extend((1,2,3,4,5,6))
print(rb, '\n--------------------------------------------------------------')
rb.append(17)
print(rb, '\n--------------------------------------------------------------')