So in the previous session, of course, we have added this feature into our virtual assistant using
which it is able to tell us a joke using this product liability.
So in this section of the course, we are going to be adding another feature into what assistant using
which it will be able to take a screenshot of our screen.
So for that, first of all, I will create another function.
So we will go back into our function section and we are going to be creating another function.
So in here we're going to creating another function.
We will name it a screenshot.
Screenshot.
And there are few spaces in between here and inside this function, we're going to be using this library,
which we have already installed, which is by Otagi and inside this function.
We are going to be creating a variable name, which will be the image name.
So I will just underscore I.
M.G., which would be EQUASS to.
In and we are going to be converting the time.
Dark, daytime, dark now, and we're going to be calling this function and we are going to be studying
the name of the image in the form of daytime.
And in the next line, we are going to be passing the part for this image.
So we will just type name underscore I am equals to and inside here we are going to be adding the part.
So we will just try to create another folder inside.
Our job is to point of order and we will name it a screenshot screen shot and we will just copy the
part for this folder.
So I will just copy paste from here and we will pasted in here and I will just minimize it.
And what we will do is we will add.
I will just act forward here, so.
And at the end of will just go forward slash and we will go.
Dark energy and a little dark for Mac, and we will pass neme underscore image, so it will name the
image using this date time and time dot now.
So it will get the current day time and it will name that image that and after that and in the next
line we will create a variable name AMG, which will be equals to UI dot screenshot.
And after that, we're going to be putting the name of the image so we will pass name Underscore IMT
and after that for religious call I M.G. talk show function.
So it will open the image for us.
And I think that's it for this function, and after that, we will move back to our main function and
in that, after this, a live statement of jokes, we are going to be adding another live statement.
So we will just type your screenshot.
In Kudi
at the time, we're going to be calling the screenshot function, and if we just try to save this code
and if we try to run it, so it should take the screenshot if we ask a lot of attention to take the
screenshot.
So let's try and see if it works or not.
Hello, this is Jarvis.
Giris, take a screenshot.
OK, I think that is an issue with converting this all the time, the time they're not into an integer.
So what we'll do is we'll just remove the ink from this part.
So I will just try to remove it.
And if we save the program again.
So it should not work.
Hello, this is Jarvis.
Giris, take a screenshot.
OK, that is still some issue, OK?
Whatever laws, we will just try to see it as as a start being and we will just remove this talk format
from here and let's see if it works or not.
No.
Hello, this is Jarvis Jarvis, take a screenshot.
OK, so as you guys can see, here is a screenshot which it has taken, uh, using this function, which
is the screenshot function.
I don't know why this thing is not working with this time now, so I will just try to solve it and show
you how we can add a custom day time into this thing.
So let's just see if it works or not.
So two, at the current time, what we will do is we will just import another module.
That will be the time module at the top of our program.
We will just import time.
And after that and the screenshot function, we will just replace this two time dot time.
And we will try to save it and we will just replace this thing with.
Neame.
Underscore, IMT and will say to upstream, and if we try to save the code and if we try to run it again.
So this thing should be OK.
This is Jarvis.
Jarvis, take a screenshot.
Yes.
So I have replaced this import as duty, so we will just replace this thing from here.
To do it because it is overlapping the time function, which we have already created.
So if I try to say it again and if we try to run it again, so it should work now.
Hello, this is Jarvis Jarvis.
Take a screenshot.
OK, so as you guys can see here, here is a screenshot which it has taken, so I just stopped the program
for now and you can see that it has taken the screenshot and saved it with a random number.
So we will just go to our we just to the code and see inside this folder, you can see that there is
an screenshot and here is the value of time.
Dot, not so you can see that it has taken the screenshot using our function.
So this is how you can add a feature into what you're interested in using, which it can take screenshot
and store it inside this screenshot folder.
So you just need to go on our virtual assistant to take the screenshot and it will take the screenshot
and store it with a random value in the form of being inside this folder, which is a screenshot folder.
So that was a poor decision.
Let's move to the next section of this quote.