Skip to playerSkip to main contentSkip to footer
  • 5/23/2025
A Python module is a file containing Python definitions and statements, such as functions, classes, and variables. Modules help organize and reuse code, making programs more readable and manageable. You can import modules into other Python scripts to use their functions and variables.
Key aspects of Python modules:

Organization: Modules provide a way to break down large programs into smaller, more manageable pieces.

Reusability: You can reuse code defined in modules across multiple projects.
Importing: The import statement is used to bring in a module's code into your current script.
Structure: Modules are typically saved as .py files, with the filename serving as the module name.
Content: Modules can contain functions, classes, variables, and executable code.

Category

📚
Learning
Transcript
00:00These three basic questions.
00:01If you have a question, you will be well set off for Mujool for the rest of your life.
00:08The first question is, is Mujool what is?
00:12The second question is, if you have a question, what is the first thing?
00:18Why do you need it?
00:21The second question is, if you have a question, what is the first thing?
00:26The third question is, is it a second question?
00:30Let's create another one. Let's call it Germany.py.
00:47Let's create another one. America.py.
00:51This is a module. Let's create another module. Italy.py.
00:55China, America, Germany. These are modules.
01:01There are a module.
01:05Question.
01:08Why does it work?
01:10Problem is that when you can work with software company or project,
01:17I promise you on this.
01:19I promise you on this.
01:19I promise you on this.
01:21I promise you on this.
01:22I promise you on this.
01:22I promise you on this.
01:24And you say, this is our total company's asset.
01:27Single.py.
01:28So, let's do this work.
01:29Never in your life will this ever happen.
01:34How about that?
01:35Is this cool?
01:36It's very cool.
01:37When you have code, let's say 100,000 lines,
01:42then you can break the code in different files and store them.
01:47Then you get it in different files.
01:49Then you can store them.
01:50And then you can store them.
01:50Then you can import them.
01:53Then you can use them.
01:55Then you choose what?
01:56Then you can do it.
01:56Because the code is big.
01:58When you can handle them, it will do it.
02:00So when you handle them, it's 154 file in addition.
02:04However, you can divide 10,000 files and make every file name and then you can utilize it.
02:12How do you do this work?
02:15Imagine, you and me are going to assembly plant.
02:23Let's say our factory name is CarAssembly.
02:29CarAssembly is very simple.
02:37Let's call the carAssembly component.
02:42First component, second component, third component and let's call the fourth component.
02:48Makes a car.
02:52Imagine, there are 4 components.
02:55This component is called body, chases, engine, tires, tires.
03:05These components are the same.
03:09However, the problem is that our assembly line is not the capability.
03:15It is not the technology that we have all the factory.
03:21We are the importer.
03:23We say that the country is good.
03:25The country is good.
03:27The country is good.
03:29The engine, tires, chases, body.
03:31We have to assemble the body.
03:32We want to assemble the body.
03:33We want to do this.
03:34We want to do this.
03:35We want to do this.
03:36We want to do this.
03:37This means that tire, engine, engine, chases, chases, body and body is not our problem.
03:45This will be in another file.
03:47We will import it.
03:48We will import it.
03:49We want to import it.
03:50Body, do it.
03:51Name it, America.
03:53To take a simple function, we have to define the body.
03:56Diff body, body body.
04:01Sorry, def, def, def, def, def.
04:02Def, b 0, d, y, body.
04:03This one simple return, one string which malice its bot.
04:05Closed, function is the racist name.
04:10Very simple function, on this term I will get to polish.
04:12We will put the function as we build.
04:14Coach, let's say chases, makeverigns.
04:18CHA and here I will say Chases.
04:22And Germany is good to make it.
04:25Germany is good to make it.
04:27And this engine is returned.
04:31And Italy is let's say Tyres.
04:34Sorry, I will say.
04:36Function copy.
04:37And here I will say Tyres.
04:42And here I will say Tyres.
04:45Now you have to think that America has a body, China has a body, Germany has a engine, Italy has a tire.
04:54Now when we have assembly plant, we have to import these things.
04:59These things are in different countries.
05:04And remember that every .py file is a module and the code we can reuse.
05:10Now let's see.
05:12I have a plant.
05:13At the moment, if I will execute it, it will give me an error.
05:16I will execute it.
05:17I will execute it.
05:19And here I will add none.
05:21None.
05:22None.
05:23None.
05:24None.
05:25None.
05:26None.
05:27None.
05:28None.
05:29None.
05:30None.
05:31None.
05:32None.
05:33None.
05:34None.
05:35None.
05:36None.
05:37None.
05:38None.
05:39None.
05:40None.
05:41None.
05:42None.
05:43None.
05:44None.
05:45None.
05:46None.
05:47None.
05:48None.
05:49None.
05:50None.
05:51None.
05:52None.
05:53None.
05:54None.
05:55None.
05:56None.
05:57None.
05:58None.
05:59None.
06:00None.
06:01None.
06:02None.
06:03we can import something, which we can import, which we can import, which we can import.
06:07So, let's do it.
06:09We need the body.
06:11Body is where we can import.
06:13Body is where we can import.
06:15From America import body.
06:19There is no problem.
06:21Now, I can use this body in my factory.
06:25Body function is called.
06:27Body function is called.
06:29Body function is called.
06:31Now, I will go back and run.
06:35Body is called.
06:37Body makes a car.
06:39We have three components.
06:43There are tires, engines and chases.
06:47Chases are called.
06:49Chases are called.
06:51Chases are called.
06:53Chases are called.
06:55From China import chases.
06:59Chases are called.
07:01Chases is called.
07:03Chases import.
07:05Simple.
07:07Chases call.
07:09Chases call.
07:11Chases call.
07:13Chases as it has.
07:15Chases are called.
07:17Now I can call the chases on my other place.
07:21Now I can execute the body and chases, none makes a car.
07:26Now our car is not full, because there is no engine and tires.
07:31The body and chases we have placed.
07:33So now we are going to import the tires and engine.
07:39We have to import the engine and tire.
07:42So we have to go to main.
07:43From Germany, import engines, and from Italy, import tires.
07:54So now we have to use the engine and tires.
07:57Now we can use the engine and engine function.
08:01And now we have to execute the tires.
08:07Now we have to execute the engine and tires.
08:12We have to do a assembly line.
08:13And what do we do with the components?
08:15We have to import the components.
08:17We import the other modules.
08:21This example is like a car.
08:23You can make a factory.
08:25You can make a assembly plant.
08:27You can make a assembly plant.
08:29And the components are like body, chases, and other components.
08:34So you import them in your country.
08:44code होता है वो आप दूसरी files जिनको
08:46module कहते हैं वहां से import कराते हैं
08:48तो I hope
08:50कि आपको ये चीज clear हो गई होगी कि module
08:52basically एक .py file का नाम है
08:54इसकी जरुवत इसलिए पड़ती है कि हम हर
08:56category के code को हम separate
08:58कर देते हैं वह इंजन अमरीका जो है
09:00body बनाता है तो अब body का जितना भी code है
09:02चाहिए वो 100 लाइनों का है
09:0410,000 का है वो यहां पर पड़ा हुआ है
09:05अब चेसिस बनाने का
09:08इंजन बनाने का, टायर्स बनाने का
09:10जितना भी procedure है वो सारा
09:12उसकी अपनी file के अंदर पड़ा हुआ है
09:14तो finally a main file के अंदर इनको
09:16import कराके simple use कर सकते हैं
09:17जैसा कि आपने देखा हैं आमने car की сделали बनाई
09:19इतना भी procedure है
09:21वो सारा उसकी अपनी file के अंदर पढ़ा हुआ है
09:24तो finally a main file के अंदर
09:26इनको import कराके simple use कर सकते हैं
09:28जैसा कि आपने देखा हमने car की buenay

Recommended

8:01
Up next