Have you ever wanted to find any particular file in a folder, but then completely freak out when you find that folder to be a hell of a mess? Well, Python is a rescue here.
Using Python OS-module and shutil module, we can organize the files with same extensions and store in separate folders.
Look at the image shown below –
This folder is fully unorganized. If you are told to find a particular file in this folder (or maybe an even larger folder with thousands of files), you will be stuck and become completely dumbstruck. It might be very tough (even impossible) to find a file from this ocean of mess. This problem can be solved using Python with a few lines of code. Let’s see how can we do this.
Below is the Python implementation –
- C API from Extension Module in Python | Set 1
- C API from Extension Module in Python | Set 2
- C Extension Module using Python
- Python - Incremental List Extension
- Python | Passing Filenames to Extension in C
- Python | Opaque Pointers in C extension modules
- Python | Repeat and Multiply list extension
- Python | Extension function operating on Arrays
- Python | Generate random numbers within a given range and store in a list
- Interact with files in Python
- Working with zip files in Python
- Writing CSV files in Python
- Working with csv files in Python
- Downloading files from web using Python
- HDF5 files in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.