I am trying to break 2 loops in Python, with one loop inside the other. Of course, when you use the break function in a loop it will only break the loop it's in. Here's the code:
while True: #Want to break this
x, y, z = sense.get_accelerometer_raw().values()
x = abs(x)
y = abs(y)
z = abs(z)
sense.show_message(strftime('%H:%M', gmtime()), scroll_speed= 0.05, text_colour=[0, 255, 0], back_colour=[255, 0, 0])
if x > 2 or y > 2 or z > 2 : #Want to break this as well
break #Break goes here??
I want to break the loop started on the top line and the loop started in line 7. How?