Hi, in this video overwrites a Python script, which, if executed, it captures the cursor and screenshots
of your screen on your computer.
So capturing screenshots through Python, the script is very short.
In total, it's three lines of code.
So all you have to do is from Ms.
S Import Ms.
So Emma says it's a third party Python library, which you need to install from the terminal with PIP
Install Emesis.
Then all you have to do is open a with context manager and say with MRS.
So that function as screen, so this is just just a variable you can write or whatever you like on that
variable that's shot given an ultimate argument equals to something like.
Screenshot that's P and G.
So that's the path to the generated file screen that shots outputs.
Yeah.
So just execute this and you should be able to see a screenshot now on Windows.
This will work right away, but if you are on Mac, you probably will see this empty screen.
So normally I should see the I.D. shown on the screenshot above.
This didn't happen because on Mac, you have to turn on permissions in the security settings to do that.
So you go to the apple, I can go to system preferences and search for security and privacy settings.
And then go to the Privacy tab and then go to the recording section of the record, a screen recording
section here and then press vets look.
Give the passwords, then what you want to do here is you want to add your I.D. among these programs.
In my case, I'm using my charm.
So I want to allow my charm to take screenshots.
So I press that plus button and you want to go to the applications for there were porch or is supply
charm.
In my case, it could be visual studio code in your case or other I.D. And they say that I have to quit
and reopen my charm.
So that's really restored by charm.
And then I can throw it and run again of the coat.
And check screenshots, don't be angry.
It needed a few seconds to refresh, so that's a new image.
There's a current screenshot at the time of the script execution.
So in the settings now pie charts should be added here and checked with this checkbox here.
And that is a complete codes for this script.
So thank you.