stepper-clock/Settings.py
2020-03-19 23:05:35 +01:00

25 lines
648 B
Python

selectedSound=0
alarmTime=((1,2,3,4),(8,),(0,))
def printState():
print("selectedSound=",selectedSound)
print("alarmTime=",alarmTime)
def save():
global selectedSound
lines = []
with open("Settings.py",'r') as rf:
for l in rf:
lines.append(l)
with open("Settings.py",'w') as wf:
for l in lines:
if l.startswith("selectedSound"):
wf.write("selectedSound="+str(selectedSound)+"\n")
elif l.startswith("alarmTime"):
wf.write("alarmTime="+str(alarmTime)+"\n")
else:
wf.write(l)
#printState()
#printState()