Catch stop program, when i stop Manualy over Thonny Python editor

Hello,

If i run a Python program over Thonny Editor, and i stop it, i Would like to create a meassage Like program is stopped.
But with Try except it Dosnot work, could Someone help me?

Thx
stef

My Code so far:

Import sys

Try:
While True:
Print(„ program Runs“)

Except:
If quit():
Print(„ program stop“)
Finally:
Print(„Programm was stopped“)

Dusty09,

Welcome to the ActiveState Platform, where the focus is really on the runtime environment on which your code runs, rather than the code itself. If you don’t get a reply here, your may want to consider submitting your question to someplace like StackOverflow.