Spaces:
Paused
Paused
File size: 420 Bytes
37b2e1b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import os
# Specify the file path
file_path = "./status.txt"
if os.path.exists(file_path):
with open(file_path, 'r') as file:
content = file.read().strip()
if content == "running":
print("file already running")
exit() # Exit the program if the file already says "running"
with open(file_path, 'w') as file:
file.write("running")
print("file status set to running")
|