9 lines
224 B
Python
9 lines
224 B
Python
class Ring_buffer:
|
|
def __init__(self,size):
|
|
self.size = size
|
|
self.data = []
|
|
|
|
def append(self, data):
|
|
self.data.append(data)
|
|
if len(self.data) == self.size:
|
|
self.data.pop(0) |