You put program code in a loop and designate one key to break out of loop:
# this is an example of your program:
print "My program! Really!"
choice = raw_input("Enter r (repeat) or q (quit): ")
if 'q' in choice:
break # exits the while loop, any other key repeats loop
Here is another example how to do this, as suggested by cscgal ...
# save this code as endless.py
password = raw_input("I am running almost endlessly unless you enter the secret password: ")
if 'q' in password:
raise SystemExit, "I am quitting now ..."
Notice how the ultimate escape has been accomplished.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...