To sort all the files of folder properly
To locate the files as per their extension or type.
-
Here we first fetch the path of the current folder and than get the extension of each file and then sort the file according to that -For example ,if extensions are .pdf , .docx then it will go to documents folder simillarly for images>.jpg,.png,.gif ,for videos > .mp4,.wmv and for apps>.apk,.exe .
-
List out the libraries imported > os , shutil
- First have the script in the same folder in whuch you wanted to sort the files and then run the script so as a result different folders will be formed accordingly.
- Fisrt install the libraries and then run the script so all the files will be allocated in images,videos,apps and documents folder respectively.
Neel Shah