I am attempting to create an array in python that is capped at 60 values. My array starts with 0 values and then every minute, it adds a value to the array. When a new value is added, I want the oldest value added, i.e the last to get removed when the newest value is added (keeping the length at 60). Here is (parts) of my code so far...
pList = []
i = 0
while(True):
pcList.append(x)
if(i >= 60):
#??
i = i + 1
time.sleep(60)
I am unsure about how to go about removing the last (first value) when it gets to 60 values when adding a new one.