Python Forum

Full Version: OS module and file/directory recovery
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I just came across the Python os module and have been tinkering with it. From what I've seen, it's pretty unforgiving when it comes to deleting folders (and probably files as well). I used the os.rmdir and shutil.rmtree and do not see these folders in the Recycle Bin. Is there a way to send files and folders to the Recycle Bin (rather than just vanquishing them forever)? These commands seem pretty risky if you don't watch what you're doing.

And for those who don't know, the OS module provides functions for interacting with the operating system. So, it's probably something that will come in handy for everyone.
You could explore the send2trash project on pypi to see how it works on your platform.