Inspiration
It was inspired by horror movies that show blinking lights before a jumpscare or scary scene.
I tried to recreate that tension using Python on digital screens.
What It Does
Initial Setup
- Creates a fullscreen, transparent window that covers your entire screen
- The window is click-through initially, meaning you can still use your computer normally
- Loads background music and sound effects from a
soundsfolder - Starts playing background music that loops continuously
- Creates a fullscreen, transparent window that covers your entire screen
3-Second Wait
- The program waits 3 seconds after you run it (building suspense)
- The program waits 3 seconds after you run it (building suspense)
Black Screen Blinking (8 blinks)
- Your screen suddenly turns black
- It blinks 8 times (alternating between pure black and near-black
#050505) - Each blink lasts 1 second
- After blinking, the screen stays black for another 3 seconds
- Your screen suddenly turns black
Haunted Notepad Sequence
- Closes any open Notepad instances using
taskkill - Opens a fresh Notepad window
- Changes Notepad font size to 18pt through the Windows Registry
- Reads text from
random.txt - Types it character-by-character automatically with keyboard sounds:
- First 10 characters: slow (0.3 seconds each) — dramatic effect
- Remaining characters: fast (0.01 seconds each)
- Each keystroke plays
keyboard.mp3sound
- First 10 characters: slow (0.3 seconds each) — dramatic effect
- Pauses for 3 seconds
- Goes to a new line and slowly types "DO NOT LOOK BACK" (0.3s per character)
- Closes Notepad automatically
- Shows black screen for 3 seconds
- Closes any open Notepad instances using
Jumpscare
- Displays a
jumpscare.jpgimage fullscreen with a scary sound - If no image exists, shows a red screen with “BOO!!!” text
- Waits for the jumpscare sound to finish playing before continuing
- Displays a
Thank You Message
- Stops all music
- Shows a message box: “Thank you for executing!”
- Program exits
- Stops all music
How We Built It
Built using Python and a combination of open-source libraries, sounds, and image files.
Challenges We Ran Into
Synchronizing the keyboard sound with the typing animation in Notepad was challenging.
Initially, the sound played after each keystroke, creating a delay.
The fix was to trigger the sound before pyautogui.write() instead of after.
Accomplishments We’re Proud Of
Seamless Multi-Library Integration
Successfully integrated 4 different Python libraries that don’t normally work together:tkinter(GUI)pygame(sound + events)PIL/Pillow(images)pyautogui(automation)
Advanced Window Transparency Effects
Created a sophisticated transparent overlay that:- Covers the entire screen
- Remains click-through when needed
- Can toggle visibility on demand
- Stays on top of all windows
- Covers the entire screen
What We Learned
Multiple Event Systems Can Coexist
- Lesson:
tkinter’s event loop andpygame’s event polling can work together if managed carefully - Discovery:
pygame.event.get()must be called regularly to drain the event queue, even inside tkinter apps - Solution: Regular polling with
check_for_escape()keeps both systems responsive - Application: Understanding how to bridge event paradigms between libraries
- Lesson:
Process Management Requires Aggressive Cleanup
- Lesson: Applications like Notepad can have multiple instances or linger after use
- Discovery:
taskkill /Fis sometimes necessary to ensure a clean state - Solution: Force-kill existing processes before starting new ones
- Application: External process automation often requires aggressive management
- Lesson: Applications like Notepad can have multiple instances or linger after use
Windows Registry Can Control Application Behavior
- Lesson: System applications like Notepad store settings in the Windows Registry
- Discovery: Registry values like
HKCU\Software\Microsoft\Notepad\lfHeight
control font size - Solution: Use
reg addto modify application settings programmatically - Application: Registry manipulation enables deep system customization
- Lesson: System applications like Notepad store settings in the Windows Registry
What’s Next for Haunted Window
- Configuration File
- Enhancement: Add
config.jsonfor easy customization - Benefit: Users can adjust behavior without editing the source code
- Enhancement: Add
{
"blink_count": 8,
"blink_speed": 1.0,
"typing_speed_slow": 0.3,
"typing_speed_fast": 0.01,
"haunted_message": "DO NOT LOOK BACK",
"wait_time": 3
}
Log in or sign up for Devpost to join the conversation.