AU_MERIT_SCRAP / test.py
Hashir Kashif
nakasdasdasdasdd
37b2e1b
raw
history blame contribute delete
420 Bytes
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")