1
00:00:01,610 --> 00:00:06,170
OK, in this video, we're going to start to create our first counterprogram, so open your get back

2
00:00:06,170 --> 00:00:09,410
terminal, go to your windows, start menu, type in Gitti, it'll pop right up.

3
00:00:09,600 --> 00:00:11,570
And this is what you should see.

4
00:00:11,570 --> 00:00:13,370
Now yours is going to say something different.

5
00:00:13,370 --> 00:00:17,030
My computer's logged and username is Kotomi, so says Kotomi at Kotomi.

6
00:00:17,240 --> 00:00:20,780
Whatever your Windows username is, it'll show up there doesn't matter at all.

7
00:00:21,080 --> 00:00:25,760
But now we want to create a directory to hold all of our program files that are going to be creating

8
00:00:25,760 --> 00:00:26,630
all of the code that we're in.

9
00:00:26,650 --> 00:00:26,900
Right.

10
00:00:26,920 --> 00:00:29,150
So to do that, we can create a directory.

11
00:00:29,150 --> 00:00:34,310
Let's go like Diaa and we want to put this in the C drive and let's call this directory paint.

12
00:00:35,670 --> 00:00:40,770
OK, now we want to move into that directory, I should mention, if you're on Mac or Linux, it's obviously

13
00:00:40,770 --> 00:00:44,610
not C because Mac and Linux don't have a C directory.

14
00:00:45,060 --> 00:00:47,430
You could just save this anywhere you want on your computer.

15
00:00:47,970 --> 00:00:50,580
Just call it paint or call it anything you want, really.

16
00:00:50,580 --> 00:00:53,880
But we're creating a paint program, so I'm going to call the directory paint.

17
00:00:54,070 --> 00:00:55,890
So now we need to move into that director.

18
00:00:55,890 --> 00:01:01,440
We need to change directory CD and then we could just type N C paint.

19
00:01:02,490 --> 00:01:04,830
And when we do that, we could see where we are.

20
00:01:05,800 --> 00:01:12,250
Right now, if we type in less, there's nothing actually in this file or in this directory right now,

21
00:01:12,460 --> 00:01:14,380
but we'll go ahead and put something in there right now.

22
00:01:14,390 --> 00:01:18,820
So let's head over to a sublime text editor and open it up.

23
00:01:18,820 --> 00:01:22,020
Now, I've put some starter code in here and we'll talk about this in just a second.

24
00:01:22,270 --> 00:01:27,850
What we want to do first is come here, come up here to file and click, save as and then navigate to

25
00:01:27,850 --> 00:01:28,810
your C drive.

26
00:01:28,810 --> 00:01:33,040
You may have to kind of search around for it over here and click this.

27
00:01:33,050 --> 00:01:40,720
P.S. Here's my C drive and then look for that paint directory we just created there alphabetically.

28
00:01:40,720 --> 00:01:44,350
So just hunt through there to see it and then double click it to go into it.

29
00:01:44,590 --> 00:01:46,210
And now what do we want to call this.

30
00:01:46,210 --> 00:01:50,710
Let's just call this paint DCPI these are Python program.

31
00:01:50,710 --> 00:01:55,320
So and then the dot pi file extension click save and there we go.

32
00:01:55,330 --> 00:02:00,970
So if we head back over to our terminal and now type in, we'll see that paint file is right there.

33
00:02:01,210 --> 00:02:06,040
Now in order to run this from now on, we'll just type in python paint, dot pi.

34
00:02:06,370 --> 00:02:07,210
There's nothing there yet.

35
00:02:07,210 --> 00:02:08,260
So I'm not going to run this.

36
00:02:08,380 --> 00:02:13,780
If you're on Mac or Linux, you may have to type Python three hain't that pie like that.

37
00:02:13,780 --> 00:02:18,340
So try it without if it doesn't work at the three in front of it and it should work.

38
00:02:18,640 --> 00:02:18,970
So.

39
00:02:18,970 --> 00:02:20,560
All right, let's look back at our code.

40
00:02:20,830 --> 00:02:24,640
So to create any counter programs, you always start with this line.

41
00:02:24,640 --> 00:02:29,920
So we're going to import Kanter now Kanter comes or Kanter I should mention I'm just going to call it

42
00:02:29,920 --> 00:02:35,260
Kintyre from now on the tee is probably not silent in real life, but in my mind it should be so I'm

43
00:02:35,260 --> 00:02:36,220
just going to call it Kanter.

44
00:02:36,460 --> 00:02:41,890
I've created hundreds of videos on Kanter so I feel like I can call it Kanter if I want to call it Kanter.

45
00:02:42,340 --> 00:02:48,100
It's just easier so to create a counterprogram we always at the beginning from Kanter import everything

46
00:02:48,220 --> 00:02:50,050
and Kanter comes with Python.

47
00:02:50,050 --> 00:02:50,920
It's already there.

48
00:02:50,920 --> 00:02:53,080
We just have to import it into our program.

49
00:02:53,290 --> 00:02:55,300
So OK we've got that now.

50
00:02:55,450 --> 00:03:01,180
We always start out by creating a window and I'm going to call our window a route that's sort of common.

51
00:03:01,180 --> 00:03:03,460
And this is a Teekay instance, right.

52
00:03:03,460 --> 00:03:04,630
A counter instance.

53
00:03:04,870 --> 00:03:06,790
And then we can give this a title.

54
00:03:06,790 --> 00:03:13,390
I'm going to call it Kotomi Dotcom Paint Program and then we can set the size we want.

55
00:03:13,390 --> 00:03:14,420
I'm going to just say eight hundred.

56
00:03:14,440 --> 00:03:16,360
I hate eight hundred to make a big box.

57
00:03:16,540 --> 00:03:18,730
And then down here we have root main loop.

58
00:03:19,000 --> 00:03:24,520
The main loop of a counterprogram is the thing that's always looping, it's always seeing and what's

59
00:03:24,520 --> 00:03:25,120
going on.

60
00:03:25,120 --> 00:03:29,410
So if you move your mouse that loop notices every time the mouse moves.

61
00:03:29,410 --> 00:03:33,770
If you click a button, that loop is looping and it notices that you've click the button.

62
00:03:33,790 --> 00:03:38,230
It's the loop that is always running and makes the program a program.

63
00:03:38,230 --> 00:03:42,400
So we always keep that and usually put that at the bottom so we can go ahead and say this.

64
00:03:42,400 --> 00:03:47,710
I'm just going to hit control on my keyboard or even come up here to file save and then head over to

65
00:03:47,710 --> 00:03:52,120
our terminal and then type in python paint dot and enter.

66
00:03:53,750 --> 00:03:59,150
And when you do this thing pops up, it's eight hundred by eight hundred, you see the Tidal Economy.com

67
00:03:59,150 --> 00:04:01,100
paint program, there's nothing there yet.

68
00:04:01,100 --> 00:04:05,450
But hey, congratulations, this is your first counterprogram, at least for this course.

69
00:04:05,660 --> 00:04:05,990
So.

70
00:04:05,990 --> 00:04:06,350
All right.

71
00:04:06,350 --> 00:04:09,770
So let's go ahead and close this, and that'll be all for this video.

72
00:04:09,770 --> 00:04:12,080
In the next video, we'll start to create our canvas.
