F
4

My first Python script deleted my whole downloads folder

I was sitting in a coffee shop on Main Street trying to follow a tutorial on file management. Accidentally used os.remove() in a loop without testing it first and watched 300 files disappear in about 2 seconds. Anyone else ruin something important when they were learning?
3 comments

Log in to join the discussion

Log In
3 Comments
gavin469
gavin4697d ago
Ever try running it directly on your desktop instead of a test folder first? Scripts go bad fast when you skip the sandbox.
10
angelarivera
Did you ever try running it in a virtual environment first? That saved me after I nuked my project folder once lol.
5
jamie804
jamie8047d ago
Tbh I once deleted my entire iTunes library in 2009 organizing a wedding playlist.
3