Ask coding questions

← Back to all posts
need help
JacobMcPherson1

How do you make the files (except main.py) delete themselves after the program is stopped

Voters
JacobMcPherson1
Comments
hotnewtop
19ecal

Well, you can tell users to send KeyboardInterrupt (Ctrl+C) when they are done and then use something like this

does that help?

JacobMcPherson1

@19ecal well chicken said that if someone other than the repl owner runs the repl, it'll delete the files. But thanks anyway

Bookie0

Here check this out, it kinda responds to your question, but won't delete files automatically after the program is stopped. Give it a try though! :)

ch1ck3n

if someone besides the owner of a reply runs it and stops it all of the files except main.py will be deleted. so try using an alt account to run it.