25
My first Python script deleted a whole folder of vacation photos before I hit Ctrl+Z
I was working late at my kitchen table, writing a script to clean up old text files. I mixed up the path variable and pointed it at my 'Pictures' folder instead. The script ran and wiped about 200 photos from my trip to Seattle last year in a second. I felt my stomach drop. I found a free file recovery tool called Recuva online and, after an hour of panic, got almost all of them back. Has anyone else had a close call like that with a simple mistake in their code?
2 comments
Log in to join the discussion
Log In2 Comments
the_ruby1mo ago
Did you test the script on a dummy folder first? That's a brutal way to learn about dry runs. Always makes me triple-check the path now. What was the recovery process like, was it straightforward or a total nightmare?
7
milar461mo ago
You didn't do a dry run first?
3