3:12 . The Function na is tuan_second() but while you call it at 4:50 when you call tuna.second() . It should throw an error right? Tuna_Second() function does not exist.
What is the exact difference between a library and a package? Some people say they are the same. Others say they are basically the same. Basically the same implies that there are still some differences. So what is the difference between a library and a package? What do they contain?
A module is a set of functions, types, classes, ... put together in a common namespace. A library is a set of modules which makes sense to be together and that can be used in a program or another library. A package is a unit of distribution that can contain a library or an executable or both. It's a way to share your code with the community.
how to import modules from different modules which are in different package all together, one way I know is executing at main root directory, is there any best way? thank you.
Add a file __init__.py (can be blank) to folders files, folder1 and folder2. Then you got a package files with sub-packages folder1 and folder2. After this you can import from the main.py like this from files.folder1 import *
When you do import X and python finds a folder called X in a folder on your sys.path then it will look in that folder for an __init__.py to be considered the top level module. (Note that if the package is not on your sys.path then you would need to appendit's location to be able to import it.) If that is not present it will look for a __init__.pyc version possibly in the __pycache__ folder, if that is also missing then that folder X is not considered a loadable python package. If no other options for foo are found then an ImportError is raised.
Straightforward, clear, and so very helpful...72 year old hobbyist appreciates this video!
Practically clear explanation sir. Thank you so much sir
Thats why INDIAN are the Greatest.
So nice bro your explanation is too good
many thanks for giving fully understand of it.
I highly appreciate to someone'need.
thanks bhai Its really helpful to me
Thank you bro it's really very help full
I am curious about that file at 8:42......'What Happens When You Try To Steal A R......."
same here
3:12 . The Function na is tuan_second() but while you call it at 4:50 when you call tuna.second() . It should throw an error right? Tuna_Second() function does not exist.
Ya same question i have!! When did you go and fix that spelling error of tuan for tuna?
@@albratossk7030 yes yes I noticed the same too
@@GIT_Somya Watch the runtime. it skips forward 1 or 2 minutes
Thank you so much bro.. Finally, i fully understood.
Good explanation Bro
Very well explained. One can also define list of sub modules to import in __init__.py file.
Great video and explanation. Thanks
Why did you stopped making videos boy??
you explain awesome. Make videos at least in this quarantine time.
easy to understand. very nice video
Very good Explanation
Thank you u explained in the easiest way🤗😍
Thanks a lot bud🥰
well explained
Thank you very much sir
really great super...
Very informative
Thank you soooooooooo much bro
why cant we just call just file name like first or second just (import first - will it display )
The video is good
Thanks , video is easy for understanding, Where i can get ready made package download
You are Amazing.
Thanks sir 😊
Thank you!
how can we remeber if there are many packages and callinf all them (first.tuna.......)
If we try to import python_package from python shell it doesn't work
Why
What is the exact difference between a library and a package? Some people say they are the same. Others say they are basically the same. Basically the same implies that there are still some differences.
So what is the difference between a library and a package? What do they contain?
A module is a set of functions, types, classes, ... put together in a common namespace.
A library is a set of modules which makes sense to be together and that can be used in a program or another library.
A package is a unit of distribution that can contain a library or an executable or both. It's a way to share your code with the community.
Thank you
thank you for your video it was so clear and helpful
great! thank you.
how to import modules from different modules which are in different package all together, one way I know is executing at main root directory, is there any best way? thank you.
Add a file __init__.py (can be blank) to folders files, folder1 and folder2. Then you got a package files with sub-packages folder1 and folder2. After this you can import from the main.py like this
from files.folder1 import *
How to import all the module ,can we use import *
no
from module_name import *
example -
from math import *
Bro even though I kept .py extension it is still a text document...can anyone help me
same problem here
What was the use of init file?
just to specify that the folder is a package
I am executing without __init__ also the output was coming for me ???
When you do import X and python finds a folder called X in a folder on your sys.path then it will look in that folder for an __init__.py to be considered the top level module.
(Note that if the package is not on your sys.path then you would need to appendit's location to be able to import it.)
If that is not present it will look for a __init__.pyc version possibly in the __pycache__ folder, if that is also missing then that folder X is not considered a loadable python package. If no other options for foo are found then an ImportError is raised.
Mera save nahi ho raha
Thank you
Thank you