1
00:00:00,210 --> 00:00:02,730
And this is my solution to the exercise.

2
00:00:03,780 --> 00:00:06,630
So let me run it, and then I explain the code to you.

3
00:00:07,820 --> 00:00:14,600
Once they were on the scripts, then these files were changed from dust to dust, see as V.

4
00:00:15,710 --> 00:00:21,560
And this is my code, so I import path and then I declare to the root directory, which is where the

5
00:00:21,560 --> 00:00:25,550
files that we want to change are located.

6
00:00:25,640 --> 00:00:27,050
So inside files.

7
00:00:27,590 --> 00:00:31,970
And then we do this through our globe.

8
00:00:32,210 --> 00:00:35,360
Now you have different alternatives for this.

9
00:00:35,690 --> 00:00:38,540
You could also do just like that.

10
00:00:39,920 --> 00:00:41,150
This would also work.

11
00:00:41,390 --> 00:00:45,170
So if I run this and change them back to to run.

12
00:00:46,750 --> 00:00:50,750
The conversion will still work, even if you do that.

13
00:00:52,000 --> 00:00:55,930
And here you change back to V Vets will also work.

14
00:00:56,560 --> 00:00:58,360
Our globe also works.

15
00:00:58,840 --> 00:01:01,750
So see as we don't run.

16
00:01:03,300 --> 00:01:04,170
Again, it works.

17
00:01:04,440 --> 00:01:06,810
So why did I use our globe?

18
00:01:07,170 --> 00:01:08,700
So that's what I used.

19
00:01:09,210 --> 00:01:19,920
Well, our globe is an alternative to Globe, and our globe is useful when you have subfolders and subfolders

20
00:01:19,920 --> 00:01:21,450
in one directory.

21
00:01:21,750 --> 00:01:23,670
So in this case, it's not very useful.

22
00:01:24,150 --> 00:01:26,850
But if we had two different folders here, then.

23
00:01:27,860 --> 00:01:28,820
Our globe.

24
00:01:28,910 --> 00:01:34,250
So this is the equivalent of doing that.

25
00:01:34,880 --> 00:01:39,560
So that is the equivalent of our globe with the first asterisks.

26
00:01:39,950 --> 00:01:41,390
And with all of this slash.

27
00:01:43,280 --> 00:01:48,960
So I hope that's clear for you, and then the codes go like this.

28
00:01:48,980 --> 00:01:52,310
I check if the file is a file.

29
00:01:52,340 --> 00:01:54,410
This is not necessary in our case again.

30
00:01:55,070 --> 00:01:57,620
But otherwise it's a good check you can do.

31
00:01:58,100 --> 00:01:59,900
And new file path.

32
00:02:00,830 --> 00:02:08,780
So this is a key here of the code that changes the text, the extension to see as V and vice versa.

33
00:02:09,020 --> 00:02:17,420
So with a suffix, it's a method which changes only the extension parts of the file name and it returns

34
00:02:17,420 --> 00:02:19,300
a new path object.

35
00:02:19,370 --> 00:02:19,790
Right?

36
00:02:20,180 --> 00:02:22,880
And we saw that a new file path.

37
00:02:23,150 --> 00:02:29,390
And then we rename the existing path using that new file path, which now has the new extension.

38
00:02:29,840 --> 00:02:30,380
And that's it.

39
00:02:30,920 --> 00:02:31,350
Thank you.

40
00:02:31,370 --> 00:02:32,420
And I'll talk to you later.

