Turn the previous write-and-read example into two reusable helpers. One saves a signal; the other returns the saved text.
Use "w" to replace the previous contents and "r" to read them. Keep each file operation inside a with open block. As before, the file is temporary and does not download to your device.
Edit main.py. The supplied calls save a signal before loading it. Run to see the restored text, then Submit.
save_signal(text) to write text to shrine-save.txt using with open(..., "w", encoding="utf-8").load_signal() to return the entire file using read mode and with open.