Spaces:
Sleeping
Sleeping
Update your_script.py
Browse files- your_script.py +4 -0
your_script.py
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
import time
|
|
|
|
|
|
|
2 |
|
3 |
# Open the file in append mode
|
4 |
with open("outputs/message.txt", "a") as file:
|
@@ -6,5 +9,6 @@ with open("outputs/message.txt", "a") as file:
|
|
6 |
for i in range(60):
|
7 |
# Append the value of i to the file
|
8 |
file.write(str(i) + "\n")
|
|
|
9 |
# Wait for 1 second
|
10 |
time.sleep(1)
|
|
|
1 |
import time
|
2 |
+
from pathlib import Path
|
3 |
+
|
4 |
+
Path('outputs').mkdir(exist_ok=True, parents=True)
|
5 |
|
6 |
# Open the file in append mode
|
7 |
with open("outputs/message.txt", "a") as file:
|
|
|
9 |
for i in range(60):
|
10 |
# Append the value of i to the file
|
11 |
file.write(str(i) + "\n")
|
12 |
+
print(f"Wrote {i}. Sleeping for 1 second")
|
13 |
# Wait for 1 second
|
14 |
time.sleep(1)
|