I have this function def to save some variable value I have add it manually by remote control of some E2 device
def saveKey(key):
try:
f=open("/etc/savekeys","w")
f.write(str(key.replace("|", "")))
f.close()
except:
pass
The value that save is like
7777776577777765
or
777AACD77777AACD
But every time I save a new value, the old value is deleted. I nedd to modify the def to make it save only 5 values, and when I save value number 6 it takes the place of number 1 and value number 7 takes the place of 2 and value number 8 takes the place of 3 ... etc ?!!