0
I dont really understand the concept of modules
Are the modules like already predefined constants
13 ответов
+ 6
Module is simply a collection of infinite number of codes Python devs wrote for you and you can simply use them in your code by writing import and then module name. And yes, you can create your own modules.
+ 2
u can also add own modules to local direcory.
So but why modules :
in the kitchen you have things you need every day to cook:
maybe grain, eggs..
Some other things you may have in on stock because u need them occasionally.
And some special things you buy when you need.
If u had all in the kitchen it would become narrow there.
The idea for modules is similar :
A set of very common functions is standard in runtime(kitchen) .
Some more modules are standard in the library and available by importing them(stock) .
For special cases you can install further modules from pypi(discounter) .
0
Python... sorry
0
I have already read that but I still don't understand......are the modules already predefined constants like pi...or predefined function like sqrt
0
Ok who created the maths module.....and can I create my own module
0
Would the .py file be saved with the file ....like how would the idle know where to import it from
0
And where can I download modules from
0
Modules like math are in the standard library so there is no need to install anything, but external modules need to be installed with pip. Yes you can also create your own modules, and even publish them to PyPi if you want.