Spaces:
Sleeping
Sleeping
import time | |
from pathlib import Path | |
Path('outputs').mkdir(exist_ok=True, parents=True) | |
# Open the file in append mode | |
with open("outputs/message.txt", "a") as file: | |
for i in range(20): | |
# Append the value of i to the file | |
file.write(str(i) + "\n") | |
print(f"Wrote {i}. Sleeping for 1 min") | |
# Wait for a minute | |
time.sleep(60) | |
Path('done.txt').touch() |