1 00:00:00,640 --> 00:00:04,210 All right, now it's time to talk about the packages and the mojos in Python. 2 00:00:04,290 --> 00:00:11,060 OK, so actually you can see or you remember when we created our first first file. 3 00:00:11,620 --> 00:00:14,320 OK, now it's time to be more realistic. 4 00:00:14,350 --> 00:00:20,260 OK, so here you can see that we have the first, despite now the first thing this make this directory 5 00:00:20,260 --> 00:00:21,100 and its name it. 6 00:00:22,230 --> 00:00:30,020 Biton underscore fights back and by the way, to remove this first python, we didn't need it anymore. 7 00:00:30,720 --> 00:00:34,360 So it's clear the screen and it's go to the python. 8 00:00:34,590 --> 00:00:36,180 Now, let's go to the python files. 9 00:00:36,750 --> 00:00:38,360 OK, now we're inside. 10 00:00:38,520 --> 00:00:41,780 Let's touch our first file and touch. 11 00:00:41,790 --> 00:00:44,820 This is commonly used to create a text, but it's OK. 12 00:00:45,090 --> 00:00:49,860 You can use whatever you want or you can use actually the video to do itself. 13 00:00:51,730 --> 00:00:55,370 From here, you can create a new fight from here anyway. 14 00:00:55,600 --> 00:00:56,290 They are the same. 15 00:00:56,440 --> 00:00:57,240 Nothing important. 16 00:00:57,520 --> 00:00:58,570 So many did. 17 00:00:58,590 --> 00:01:00,780 But this is the main function. 18 00:01:00,790 --> 00:01:03,090 And let's create another thing now. 19 00:01:03,100 --> 00:01:08,760 This time we want to create, um, first the first something. 20 00:01:08,920 --> 00:01:09,460 It's OK. 21 00:01:09,730 --> 00:01:13,960 OK, now let's make another directory and this directory will call it functions. 22 00:01:14,980 --> 00:01:15,930 OK, it's OK. 23 00:01:15,940 --> 00:01:16,950 Just arbitrary names. 24 00:01:17,560 --> 00:01:23,370 So we have the first date by the amended by and we have the functions now inside the functions. 25 00:01:23,380 --> 00:01:25,800 So let's go to that function inside it. 26 00:01:25,810 --> 00:01:33,790 We want to create another fight and this fight we would limit for one to by and let's create one to 27 00:01:33,790 --> 00:01:34,030 date. 28 00:01:34,030 --> 00:01:35,160 But OK. 29 00:01:36,580 --> 00:01:42,550 And you can see it now let's fight open a fight or open a folder from here. 30 00:01:43,180 --> 00:01:46,170 OK, and four there will be between fights. 31 00:01:46,300 --> 00:01:47,370 OK, now. 32 00:01:47,380 --> 00:01:48,130 OK from here. 33 00:01:49,350 --> 00:01:51,370 And you can see that we have it here. 34 00:01:51,480 --> 00:01:52,900 Let's get from this, we don't need it. 35 00:01:53,470 --> 00:01:53,760 Yeah. 36 00:01:54,120 --> 00:01:56,610 So you can see that we have the functions, we have the man. 37 00:01:56,610 --> 00:01:57,880 We have the first dead body. 38 00:01:57,950 --> 00:02:04,410 OK, so again, the first thing I will go to the man now, the men here, I will preprint. 39 00:02:05,430 --> 00:02:07,530 This thing and this thing will be called. 40 00:02:09,170 --> 00:02:12,000 This is managed by OK. 41 00:02:14,360 --> 00:02:16,680 And the first year will be great. 42 00:02:17,450 --> 00:02:18,110 This is. 43 00:02:19,340 --> 00:02:19,730 First. 44 00:02:21,230 --> 00:02:28,400 And the functions inside function one, let's define this function, function, whatever function this, 45 00:02:28,730 --> 00:02:29,410 it's no big deal. 46 00:02:29,810 --> 00:02:34,940 And this principle inside fun from fun one. 47 00:02:36,120 --> 00:02:49,140 The Twi and Functor, let's have it the same as a fun one like this, but this time it will be from 48 00:02:49,260 --> 00:02:50,730 fun to like this. 49 00:02:51,020 --> 00:02:51,360 OK. 50 00:02:52,670 --> 00:02:53,780 OK, so far, so good. 51 00:02:54,300 --> 00:03:00,570 Oh, now I want for all of these to be connected together, all can be important to them. 52 00:03:00,590 --> 00:03:06,520 So we will use this statement, which is the import statement, and I will import. 53 00:03:06,530 --> 00:03:07,640 I don't think so, actually. 54 00:03:07,640 --> 00:03:11,530 I can import my mojos library, for example. 55 00:03:11,540 --> 00:03:23,060 For us, this is a library or a module can be imported using Python and it can use all commands on the 56 00:03:23,570 --> 00:03:24,500 operating system. 57 00:03:25,730 --> 00:03:31,820 We have some processes we have mapped, we have a lot of things, actually, but all of these are standard 58 00:03:31,820 --> 00:03:32,780 or a built in. 59 00:03:33,020 --> 00:03:35,330 Now, what if I want to add one of these? 60 00:03:35,900 --> 00:03:37,580 I can do that. 61 00:03:37,710 --> 00:03:38,170 It's OK. 62 00:03:38,660 --> 00:03:45,920 So that the first thing you need to understand that we are inside the man and the man is the same level 63 00:03:45,920 --> 00:03:46,550 as first. 64 00:03:46,560 --> 00:03:49,700 So I can just add in board first. 65 00:03:49,880 --> 00:03:53,210 OK, so if I am bought first, I can do whatever I want. 66 00:03:54,630 --> 00:03:59,010 So, for example, inside first, let's remove the print statement. 67 00:03:59,130 --> 00:04:01,860 This is what I equal. 68 00:04:02,820 --> 00:04:03,300 All right. 69 00:04:03,780 --> 00:04:10,170 And here from first, I want to print that, I think, but I can't print. 70 00:04:10,180 --> 00:04:11,190 I like this. 71 00:04:11,460 --> 00:04:19,740 I need to to modify or to add this thing, which is first time, OK, and is the variable inside the 72 00:04:19,740 --> 00:04:22,680 first display, that one we we imported. 73 00:04:23,070 --> 00:04:28,040 OK, so let's print this and run them in actually to check this out. 74 00:04:28,320 --> 00:04:29,450 So let's return here. 75 00:04:30,990 --> 00:04:36,690 You can see that we have them in by or Python three that mean that. 76 00:04:36,690 --> 00:04:44,670 But yeah, everything is working as expected, which is still this is by date made it by as you can 77 00:04:44,670 --> 00:04:44,940 see. 78 00:04:46,410 --> 00:04:49,770 Now if I removed the first actually like this. 79 00:04:51,560 --> 00:04:54,280 This will not work because it is not defined here. 80 00:04:55,790 --> 00:05:02,690 Again, it's yeah, I is not defined because I is defined inside the first by which is equal. 81 00:05:03,170 --> 00:05:09,380 This is inside the first Gesell to do or to understand or to import the inside the first. 82 00:05:09,380 --> 00:05:13,070 You need to put first that I first then we can print it out. 83 00:05:13,250 --> 00:05:13,620 All right. 84 00:05:13,850 --> 00:05:15,840 And of course you need to import it first. 85 00:05:15,860 --> 00:05:16,340 All right. 86 00:05:16,790 --> 00:05:19,310 Now, what if I want to import these functions? 87 00:05:19,370 --> 00:05:21,870 OK, I want to print the function, this function. 88 00:05:22,310 --> 00:05:25,820 I want to call this function that inside one will do it. 89 00:05:26,360 --> 00:05:30,320 But when one how to do that, I need to use the import. 90 00:05:30,370 --> 00:05:30,800 Here you are. 91 00:05:30,800 --> 00:05:31,100 Right. 92 00:05:31,520 --> 00:05:37,370 But this time you can see that one one is not the same as the men, which is the one we are. 93 00:05:37,770 --> 00:05:41,250 No, they are inside the functions directory. 94 00:05:41,360 --> 00:05:45,350 So you need to put functions like this and then. 95 00:05:45,590 --> 00:05:46,340 But that. 96 00:05:48,120 --> 00:05:51,610 Simple and then use fun, won as expected. 97 00:05:52,020 --> 00:05:56,830 Now, how to print that or actually how to call this function? 98 00:05:56,850 --> 00:06:03,060 So I want to call this function, which is fun and that print this statement. 99 00:06:03,210 --> 00:06:04,020 How to do that? 100 00:06:04,770 --> 00:06:06,030 Well, you can do this. 101 00:06:07,040 --> 00:06:09,770 By putting this thing. 102 00:06:11,520 --> 00:06:12,180 Functions. 103 00:06:13,850 --> 00:06:14,630 The fun one. 104 00:06:15,740 --> 00:06:25,130 Now the fun with this, so this will call the function inside that fun one that inside the functions 105 00:06:25,130 --> 00:06:25,730 directory. 106 00:06:25,770 --> 00:06:27,800 OK, now hope this would work. 107 00:06:28,010 --> 00:06:29,810 Let's see if it is working or not. 108 00:06:31,070 --> 00:06:34,840 Now, let's clear the screen first and let's run it, yeah, inside. 109 00:06:34,900 --> 00:06:36,210 Fun, fun, fun, fun. 110 00:06:36,500 --> 00:06:39,610 And this is inside our this is meant despite. 111 00:06:39,830 --> 00:06:40,160 Yeah. 112 00:06:40,160 --> 00:06:41,420 Everything is working correctly. 113 00:06:41,690 --> 00:06:43,670 Now, this is the same thing for fun, too. 114 00:06:43,990 --> 00:06:44,960 OK, ok. 115 00:06:46,500 --> 00:06:48,240 Now, let's return for the first. 116 00:06:49,420 --> 00:06:56,680 OK, let's put a comment here, actually now by default, by the way, this is the comment in Python 117 00:06:57,100 --> 00:07:02,610 and let's print the value from the first time. 118 00:07:02,830 --> 00:07:05,520 OK, now we already show that we do not need to run it again. 119 00:07:05,890 --> 00:07:08,890 But actually, what if I don't need this to be here? 120 00:07:08,920 --> 00:07:10,330 I want to just print. 121 00:07:10,750 --> 00:07:12,940 Um, I immediately. 122 00:07:12,940 --> 00:07:14,300 OK, how to do that. 123 00:07:14,740 --> 00:07:15,600 Well it is easy. 124 00:07:16,420 --> 00:07:19,450 So Brent like this and yeah. 125 00:07:19,450 --> 00:07:21,310 As you can see, Imbert first here. 126 00:07:22,590 --> 00:07:25,350 This time, we will use this from. 127 00:07:26,760 --> 00:07:29,260 Argument or from word? 128 00:07:30,150 --> 00:07:33,150 So from first import start. 129 00:07:33,570 --> 00:07:33,960 OK. 130 00:07:35,090 --> 00:07:42,280 You can see that so I imported from first and bought everything, so this time I didn't need to. 131 00:07:42,290 --> 00:07:45,350 But the first year you can see I can print. 132 00:07:45,350 --> 00:07:47,510 I immediately saw it will print. 133 00:07:48,380 --> 00:07:49,370 I promise. 134 00:07:49,370 --> 00:07:49,460 Here. 135 00:07:49,520 --> 00:07:51,020 OK, now let's check this out. 136 00:07:52,400 --> 00:07:57,890 Yeah, you can see it has been printed without using first display inside the main. 137 00:07:59,610 --> 00:08:00,340 Another thing. 138 00:08:00,630 --> 00:08:04,480 So actually, this will be working on the functions as well. 139 00:08:04,500 --> 00:08:12,120 So if I import functions without putting functions that by and I could the function. 140 00:08:13,170 --> 00:08:20,040 But this time I called not one, and they think we already saw now this time I will print the phone 141 00:08:20,040 --> 00:08:25,830 to get noticed, comment this print statement and see if this is working or not. 142 00:08:27,360 --> 00:08:32,250 So you can see, yeah, Funchess has no attribute one to. 143 00:08:33,900 --> 00:08:34,610 Why is that? 144 00:08:34,620 --> 00:08:40,450 Because you can see that we import functions and inside functions, we cannot do anything. 145 00:08:40,470 --> 00:08:43,340 So you need to specify fun to action. 146 00:08:44,490 --> 00:08:49,300 So like this, now, if I type it, yeah, this is inside. 147 00:08:49,320 --> 00:08:50,970 Fun, fun, fun to watch. 148 00:08:51,630 --> 00:08:52,350 Thanks for watching.