Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 OS module and file/directory recovery
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.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Getting FileNotFoundError: [Errno 2] ,if tries to acees same file from sub-directory pmpinaki 2 323 May-04-2020, 03:39 PM
Last Post: pmpinaki
  FileNotFoundError: [Errno 2] No such file or directory saqib1066 23 2,902 Mar-16-2020, 01:25 PM
Last Post: saqib1066
  file directory linards 3 478 Nov-07-2019, 06:18 AM
Last Post: linards
  How do I read the HTML files in a directory and write the content into a CSV file? glittergirl 1 413 Sep-23-2019, 11:01 AM
Last Post: Larz60+
  pygame.error: /etc/timidity.cfg: No such file or directory lsepolis123 3 914 Aug-23-2019, 07:53 AM
Last Post: lsepolis123
  How do I set the path to my module one directory below my python 3.7.3 program? deac33 1 400 Jul-30-2019, 04:13 AM
Last Post: Larz60+
  Find a given file recursively inside a directory alinaveed786 1 598 Jul-01-2019, 01:53 PM
Last Post: ichabod801
  Packaging a single module(file) with a non-code file runsun 2 862 Apr-07-2019, 06:46 PM
Last Post: runsun
  Select next file in directory and keep track of what's already been selected loganpmgoa 2 623 Feb-27-2019, 11:54 PM
Last Post: loganpmgoa
  Python Directory and File Create Error basic_learner 1 699 Dec-16-2018, 11:03 AM
Last Post: buran

Forum Jump:

Users browsing this thread: 1 Guest(s)