⌨️ 5-Day Python Project: Interactive Status Monitor Build a program that acts like a control panel, responding to your key presses by changing its display and messages.
- Create
monitor.py
and set up a basic Pygame window. - Fill the window with a default light gray color.
- When the
SPACE
key is pressed, change the background color to red. - Print "ALERT! Space key pressed." to your console.
- Keep your Day 1 code.
- Add functionality: when the
RETURN
(Enter) key is pressed, change the background to green. - Print "System OK! Return key pressed." to your console.
- Add another key: when
ESCAPE
is pressed, change the background back to the default light gray. Print "System Reset."
- Keep your Day 2 code.
- When the
SPACE
key is pressed, in addition to changing the screen to red, also change the window's title to "STATUS: WARNING!". - When the
RETURN
key is pressed, change the title to "STATUS: ALL CLEAR". - When
ESCAPE
is pressed, change the title to "STATUS: IDLE". - (After core implementation) Choose two new keys (e.g., 'Q' and 'E'). For each key, pick a unique screen color and window title to display when pressed.
- Build on your Day 3 code.
- Introduce new status keys:
- When the
1
key is pressed, change the screen to a calming blue AND set the window title to "MODE: SLEEP". - When the
2
key is pressed, change the screen to a bright yellow AND set the window title to "MODE: ACTIVE".
- When the
- Add a third number key (
3
) to create another unique color and title combination (e.g., purple screen, "MODE: OFFLINE").
- Use your Day 4 code.
- Implement a toggle feature: When the
TAB
key is pressed, switch between two states:- State A: Screen is dark gray, title is "Display: OFF".
- State B: Screen is white, title is "Display: ON".
- Hint: You'll need a variable to remember which state you are in.
- (Open-ended extension) Add one more key of your choice. When this key is pressed, it should display a new, unique screen color and window title combination, perhaps showing a "special event" status.