i had read the documentation of python and many sources about the meaning of package, library, module and script , i got some and i know thats a basic question but its confusing and very important to know the difference between them.
I know this is basic question but please don’t down vote it, because sure this will be useful for others.
Package : which has __init__.py file
Module : Python file that consists of python code
Can anyone explain very easily without confusion between them.
I guess you need a very basic explanation.
What are all you’re writing on your own can be called as a script.
What are all you’re importing in your script can be called as modules. Also remember you can make your script as an importable i.e.,module by putting it into a directory which is in python path and contains an
__init__.pyfile inside it, considering your script file doesn’t contain the__name='__main__'as mentioned by Klaus. Now this directory can be called as a package as mentioned by Lie.Another representation – A package or library are the set of source files available in pypi or other git repositories that can be build against & installed to your local python version and can be imported as modules in your scripts.