1
00:00:00,590 --> 00:00:08,510
Hi, in this video overwrites a Python script, which, if executed, it captures the cursor and screenshots

2
00:00:08,510 --> 00:00:11,330
of your screen on your computer.

3
00:00:12,260 --> 00:00:17,390
So capturing screenshots through Python, the script is very short.

4
00:00:17,960 --> 00:00:20,030
In total, it's three lines of code.

5
00:00:21,170 --> 00:00:23,180
So all you have to do is from Ms.

6
00:00:23,210 --> 00:00:25,640
S Import Ms.

7
00:00:25,970 --> 00:00:33,500
So Emma says it's a third party Python library, which you need to install from the terminal with PIP

8
00:00:33,510 --> 00:00:34,970
Install Emesis.

9
00:00:39,590 --> 00:00:45,350
Then all you have to do is open a with context manager and say with MRS.

10
00:00:45,590 --> 00:00:56,450
So that function as screen, so this is just just a variable you can write or whatever you like on that

11
00:00:56,450 --> 00:01:03,350
variable that's shot given an ultimate argument equals to something like.

12
00:01:06,220 --> 00:01:08,390
Screenshot that's P and G.

13
00:01:08,540 --> 00:01:16,460
So that's the path to the generated file screen that shots outputs.

14
00:01:16,460 --> 00:01:16,670
Yeah.

15
00:01:16,940 --> 00:01:24,530
So just execute this and you should be able to see a screenshot now on Windows.

16
00:01:24,590 --> 00:01:32,000
This will work right away, but if you are on Mac, you probably will see this empty screen.

17
00:01:32,000 --> 00:01:37,700
So normally I should see the I.D. shown on the screenshot above.

18
00:01:37,700 --> 00:01:45,720
This didn't happen because on Mac, you have to turn on permissions in the security settings to do that.

19
00:01:45,720 --> 00:01:53,200
So you go to the apple, I can go to system preferences and search for security and privacy settings.

20
00:01:54,960 --> 00:02:02,130
And then go to the Privacy tab and then go to the recording section of the record, a screen recording

21
00:02:02,130 --> 00:02:04,890
section here and then press vets look.

22
00:02:06,040 --> 00:02:14,170
Give the passwords, then what you want to do here is you want to add your I.D. among these programs.

23
00:02:14,770 --> 00:02:17,030
In my case, I'm using my charm.

24
00:02:17,050 --> 00:02:20,890
So I want to allow my charm to take screenshots.

25
00:02:21,070 --> 00:02:30,130
So I press that plus button and you want to go to the applications for there were porch or is supply

26
00:02:30,130 --> 00:02:30,610
charm.

27
00:02:30,850 --> 00:02:37,420
In my case, it could be visual studio code in your case or other I.D. And they say that I have to quit

28
00:02:37,420 --> 00:02:39,370
and reopen my charm.

29
00:02:40,720 --> 00:02:42,610
So that's really restored by charm.

30
00:02:49,580 --> 00:02:51,800
And then I can throw it and run again of the coat.

31
00:02:54,330 --> 00:02:56,900
And check screenshots, don't be angry.

32
00:03:00,540 --> 00:03:04,440
It needed a few seconds to refresh, so that's a new image.

33
00:03:06,640 --> 00:03:11,500
There's a current screenshot at the time of the script execution.

34
00:03:13,000 --> 00:03:18,820
So in the settings now pie charts should be added here and checked with this checkbox here.

35
00:03:20,910 --> 00:03:23,940
And that is a complete codes for this script.

36
00:03:24,210 --> 00:03:24,780
So thank you.

