sob111 commited on
Commit
3c3e72b
·
verified ·
1 Parent(s): fa88b6b

Create idle.py

Browse files
Files changed (1) hide show
  1. idle.py +17 -0
idle.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import time
2
+
3
+ def keep_alive():
4
+ """
5
+ Keeps the Space alive by printing a message every 30 seconds.
6
+ """
7
+ print("Starting keep-alive loop. Press Ctrl+C to exit.")
8
+ try:
9
+ while True:
10
+ # This print statement is what keeps the process active.
11
+ print("🚀 Keeping the Space alive...")
12
+ time.sleep(30)
13
+ except KeyboardInterrupt:
14
+ print("\nExiting keep-alive loop.")
15
+
16
+ if __name__ == "__main__":
17
+ keep_alive()