Test...
Code: Select all
import utime
try:
print('test')
while True:
print('wait')
utime.sleep(1)
except KeyboardInterrupt as theInterrupt:
print('interrupt')
finally:
i=0
while (i<10):
print(i)
utime.sleep(1)
print('done')
Code: Select all
>>> %Run -c $EDITOR_CONTENT
test
wait
wait
wait
interrupt
0
Traceback (most recent call last):
File "<stdin>", line 13, in <module>
KeyboardInterrupt:
>>>