Moving Files and Folders To Another Directory
Are you tired of doing manual method of moving your projects or folders from one directory to another. Then you are in the right place.
It is my pleasure walking you through the approach I used.
Problem: Moving folders from one directory to another without doing copy and paste yourself.
This write up is to guide you through creating of folders, moving folders and files with a python script and as a bonus “deleting of directories”.
The steps to follow includes:
1: Importation of libraries as always.
2. Navigate to the paths where the folders or files you want to move or copy are, likewise the path where you want to move or copy them to.
3.Loop through the root, directories, files in the path
The last part of the image above shows the execution time of the project in seconds.
I moved the files in the folders first and create the folder names in another directory dynamically with the first 3 strings of the folder’s name and save the initial folders with the files in it.
Thanks for your time out here and for leaning with me. For more, stay connected.
Thanks.