Many of you might have come across the situation where you want to find a file in a directory and when you open that directory, it is messed up with all kinds of files. It is really difficult to locate the required file. How nice it would be if we can have all the files with the same extension in one directory! The job of finding the file would get simpler and it would look pretty good as well.
This problem is solved by Python. Using Python os and shutil module we can easily sort the files with the same extension and store them in separate folders.
Python Kit will be shipped to you and you can learn and build using tutorials. You can start for free today!
2. Machine Learning (Career Building Course)
4. Fraud Detection using Machine Learning
5. Machine Learning using Python
6. Movie Recommendation using ML
7. 3 Computer Vision Projects (Combo Course)
8. Computer Vision - Text Scanner
9. Computer Vision Based Mouse
10. Handwritten Digits Recognition using ML
11. Computer Vision Based Smart Selfie
To understand the concept of the project in a better way imagine that a folder is completely messed up with files of all kinds of extensions (.txt, .mp4, .csv, etc). Finding a particular file from this huge ocean of files is very tough.
After running the python script on the above folder, directories with extension names are created and files with the same extension are moved to the corresponding directory.
Python Modules used for projects:
To build this project we have to make use of two Python-modules namely: os-module and shutil-module.
Brief about them is :
OS – Module: os –module provides all the functionalities of interacting with the operating system. It provides a portable way of interacting with os dependent functionalities. os –module comes under python’s standard utility modules.
Shutil –module: The shutil module is used to manipulate the high-level operations on files and collections of files. In simpler words, shutil module is used to copy, move or remove files. It also comes under the Python standard utility module. The function that we are going to use in our project is shutil.move(src,dest). This function recursively moves a file or directory from source to a given destination. If the destination directory already exists, then the source is moved inside it. But if destination already exists but it is not a directory then it may be overwritten depending upon os.rename() semantics.
Want to develop practical skills on Python? Checkout our latest projects and start learning for free
Project Implementation
For the actual implementation of the project, we need to follow the following steps:
Software requirements: Text Editor (preferably Sublime Text), Python3.
Programming Languages: Python, OS-module, shutil module.
Skyfi Labs helps students learn practical skills by building real-world projects.
You can enrol with friends and receive kits at your doorstep
You can learn from experts, build working projects, showcase skills to the world and grab the best jobs.
Get started today!
Join 250,000+ students from 36+ countries & develop practical skills by building projects
Get kits shipped in 24 hours. Build using online tutorials.
Stay up-to-date and build projects on latest technologies