Everyone.
So now we are nearly done with our database.
Just the delete on left and delete Come on it's very simple.
Just here we have this one.
We need to select any value and click on delete.
And that back and all that one is also very easy.
But the thing Hayes as I have told you these are live in concept with that one at which value to delete.
Here you are clicking the values in this list box but we require something that can store that particular
value so that the program can have an idea that which of the rows it must has to delete.
I hope you get that one but I want to see him like these all these clicks are random so plus we let
make that clear.
And now let me move to one.
So there is something we need to get this selected through that we have clicked and for that we have
this function and it completely works on the event which is generally a click and now what we will do
in that one we will take away the label that is a global variable so that it can be used in this function
and also in other functions with the same value.
And that is something like selected row the row I have selected there.
And now what we will do we will just get the index of that particular row and parse that particular
index to delete in that way that particular rule will be deleted from the database and how we will do
that one.
So to get the index is very simple just the list and their boss selection of a closer and then selection
go.
It will provide us the index of that particular row and all after that the let me show you what I want
to see them here selected for equal to now.
I will take this index and put that in the selected row variable.
So list dot index sorry get index
data.
Now just print index save run your program and view all when I click any of these I go to index.
So this is 0 1 2 3 and 4.
So for an all after that one.
So this goal showing all after Dec. 1 now 6 after that 1 0 after that one day we go.
Now what this.
After that one will affect our program.
So what will happen if we do something like this when it will delete ditto and all up to date.
So what we need here really quite just the index we are clicking.
So for that one we will use here CDO which means just the first value statement now save run view all
day we go with only 4 7 3 0 1 3 they will.
Now we are getting the index and now at this point we can make anything with that but because we have
the index not a delete just defined delete underscore command.
There we go and do it very simple just back and not delete it just like the insert.
There we are inserting devalue here we're deleting the value.
So what we are deleting here that particular index selected or so selected drop and the zero Dettmer
now run front end would be why few all let me remove the this one this segment deleted view again the
0 0 we do not have passed that one to delete button they we have deleted and command it will do delete
Come on save close and wanted again they will view all and now delete this one again view.
They will go with that.
Now the six day we do not have that.
Now I'm going to delete this one with 1 2 to 19 delete view all day we go with that one so that it's
now deleted.
So here we are done with our database.
One more thing you can add here is like whenever you are clicking any of these values they all must
appear here.
Like if I'm clicking this one then date earning and all things will appear here so that you can analyze
better because here you need to scroll this one there and need to read the values in form of these tuples.
So how you can do that one that is again very simple.
Here we have to get selected draw.
And when you select any of detail we will just insert all the values available here in these and how
that we should determine first of all.
I will do the entry delete.
So if there's anything in that entry at that particular moment it will automatically delete that value.
Like if I have something added there then when I click that one the first it will be clear and the values
will be added then.
So even even though delete from 0 2 and there we go now this one for all 6 3 2 2 3 4 5 and 6 so at this
point they will all became clear.
And to add the values there we will do even dot insert after the end that particular selected draw.
So here just bus selected draw with the index of that particular one save.
And then I do that one run it again
view all plugging this one.
There we go in the python one 1 2 ninety.
So I'm getting data in the python that is something unexpected so let me first add this one in all of
the others.
There we go in that one.
There you go.
Now just change the tuples and the entries there like this one is one this one is going to do three
four five.
And there you go six days the tuples do three four five and six save.
Hey I'm digging one and not zero.
The reason for that one fewer students are thinking is because we also have an idea.
And we are not inserting that idea.
That's why I have taken for one.
So don't get confused with that one.
First of all clear this one alone liquid run front end.
Maybe you now just view all like any of these.
And David go so all the values are written here.
Exercise diet take on 500 it study in Python.
David.
Now you can just make these delete also and now they have no debt.
So this is about this one in the next video we will have a look at a main program.
So thanks for watching.
See the next video.