Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
python_wiki:main_program_loop [2014/11/24 22:43] billdozor |
python_wiki:main_program_loop [2015/03/09 23:26] billdozor |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Main Program Loop ====== | ====== Main Program Loop ====== | ||
+ | |||
+ | **General Information** | ||
+ | |||
This is an example of a main program loop, wrapped in a try command to catch keyboard interrupts. | This is an example of a main program loop, wrapped in a try command to catch keyboard interrupts. | ||
- | Modules required: | + | **Checklist** |
- | * signal (keyboard interrupts) | + | * Modules required: |
+ | |||
+ | ---- | ||
+ | ===== The Code ===== | ||
<code python> | <code python> | ||
Line 28: | Line 34: | ||
#trap keyboard interrupts (control+c), | #trap keyboard interrupts (control+c), | ||
except (KeyboardInterrupt): | except (KeyboardInterrupt): | ||
- | input(" | + | input(" |
continue | continue | ||
# END OF WHILE LOOP | # END OF WHILE LOOP |