Spaces:
Runtime error
Runtime error
Create idle.py
Browse files
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()
|