G
27

My first Python script deleted my entire project folder yesterday

I was trying to automate cleaning up some old files and wrote 'shutil.rmtree' with the wrong path variable. It wiped my 'learn_python' folder with 3 months of work in about two seconds. What's the dumbest mistake you've made with a beginner script?
2 comments

Log in to join the discussion

Log In
2 Comments
noah_walker16
That "wrong path variable" thing shows how tiny mistakes can wreck months of work.
4
wendy_garcia16
I spent a whole weekend once because I had a typo in a config file path... just one wrong slash. @noah_walker16 is right, it's brutal. Now I copy paths directly from the file explorer and paste them. I also make a backup of the config before I change anything. It saves so much headache later when things go sideways.
4