In this article, we will learn how to arrange the files in different directories according to their extensions. When you have a lot of files with different extension than you can simply use the script for your help.
Below is the Python implementation –
Files Not Arranged:
['arrange.py', 'mydata.pdf', 'python.exe', 'resume.doc'] ['py', 'pdf', 'exe', 'doc'] py arrange.py pdf mydata.pdf exe python.exe doc resume.doc
- How to move Files and Directories in Python
- Listing out directories and files in Python
- Python | Move or Copy Files and Directories
- Python: Get List of all empty Directories
- Python | Arrange Tuples consecutively in list
- Downloading files from web using Python
- HDF5 files in Python
- Working with zip files in Python
- Working with csv files in Python
- Interact with files in Python
- Working with PDF files in Python
- Writing CSV files in Python
- Reading CSV files in Python
- Python | Reading .ini Configuration Files
- Python - Add audio files in kivy
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.