I will come back in this lecture.
We will learn how to use bison to to meet real world task, which we all benefit from this project in
our life.
So let's begin.
The idea of this project is how to organize the files inside aspecific folders in your PC at your hard
disk.
So we will create a range folder, content file, goodbye and our folder arranged folder content as
following.
So we will save the file as arranged folder content dot by clicking control on this or by clicking file
dropdown, then it should save as and save it to our working file the following.
And that is after naming it first as arranged folder content and click save.
We first bought the python modules that we will use in our project as a OR for converting the system.
And secondly, we will import the shuttle model which make you can copy your files into specific folders.
Every file in our folder is ending with a specific extension.
We will use this file extensions to copy every type of file in a separate folder.
So current underscore they are equal or dot best dot dayanim and inScience apprentices of the dayanim
between two single codes.
Our directory.
We will complete our directory after referring to our file and paste it between the two single codes
inside the two.
Parentheses and because we and that directory of the working folder, we will replace this directory
by double under score file, Darville underscores had to refer to the working directory that we inside
it now.
And to ensure the correctness of our code, we will test it by using the python print function.
To Brent, the current directory as the following Brent between two parentheses current underscore dyche.
Then we will remove the brain function, and instead of brain function, we will complete our code as
the following using for loop to look inside the working folder that we inside it to see the extensions
of files.
Then I start to create new folders and copy these files inside it, then remove it from the working
folders as the following.
So our code will be for filename and or as dot less dir between two parentheses current dir.
So for every file and the working directory we will loop.
Throw the working directory and.
Get this file and will apply actions inside the for Loop has a following, and don't forget the column
of the for loop.
Then inside the for loop we need F conditions.
So to control the flow of the program has a following.
So F.
File name Dot, and this was between two parentheses and inside the two parenthesis two, but this is
also of the end and this was.
And the dot extension between two single codes separated by commas as the following.
So we have Peng and GBC and Jeff to be.
covid to file cold images, and we will use or as dot M.K. Dir to create a folder called Images with
Capital I as the following or as Dot Femke dialogue between two parentheses and to send gecko's images
with capital I.
Then we will use the shuttle module to copy the files in these images folder and the following.
So shuttle that cobie between two parentheses filename comma and between two single codes, images with
eye capital.
So the shuttle that Cobbe MassArt will take to arguments filename.
And the other name that the file will be covid, and now we need to add a line of code to remove.
The fires that covid to that images falder, so we will use or as dot remove Massood as a following
or as dot remove between two parentheses filename.
OK, then we will, Brent.
That the process is done as the following images.
Folder.
Between two.
Single called.
To avoid getting an error, then click on to drop down the belt at well below, build our project and
bison and we finished building our project and running it.
We must adjust our belt at bison programming language to run the cut as a bison.
We will add a nested if statement to ensure that the folder is not existed before we created it by using
go as dot M.K. Dyar method.
So f f not or as best not exists between two parentheses and and inside the two parentheses, two double
quotes.
Then inside the two double codes we will add images, but with Cappotelli, not small AI, which is
the folder name that we want to check.
If it exists or not, then we will build our project as a bison code and it will run without errors.
And so on, we can replicate this block of code for the rest of fires or any fires, you can organize
as follows.
So we will kids this block of code three times again for one for documents and one for APS and one for.
And the last time for vigils has the following that Cevat stop him to.
At the end of the project, we will add a statement all done and run our project, it will run finally,
as you see, it will be all the files and get it to the folders created.
Then it will remove the list of files that have been copied to our folders that that have been created
at this moment.
We reached the end of the project and the end of our video.
Hope you enjoyed this video and get all of that.
Thanks for being here and thanks for watching.
See you next with you.
Bye bye.