In some tutorial, for syntax from DateTime import DateTime, it is mentioned that importing DateTime object from DateTime module. Somewhere it is said importing DateTime module from DateTime package.
Can anyone explain the correct information?
In some tutorial, for syntax from DateTime import DateTime, it is mentioned that importing DateTime object from DateTime module. Somewhere it is said importing DateTime module from DateTime package.
Can anyone explain the correct information?
1-object is instance of class
2-every file of Python source code whose name ends in a .py extension is a module
3-package is collection of modules. It is a directory which contains a special file __init__.py
4-Python packages without an __init__.py file are known as “namespace packages”
5-Library is collection of various packages
6-A framework is a large codebase, or collection of code, meant to provide universal, reusable behavior for a targeted project ,frameworks are different from other external codebases, such as libraries, because they feature inversion of control
for more information visit this site: https://www.quora.com/What-is-the-difference-between-Python-modules-packages-libraries-and-frameworks
Module can be a script/library usually in the same working directory. Depending on your IDE this may take some more setup but in your working directory you can see this functionality.
create a new python script called print_stuff.py
In this script write the following:
def print_a_string():
print('Hello from print_stuff)
Then in a new script in that directory put the import
from print_stuff import print_a_string as pas
pas()
A package is, as implied, a packaged module that is available to the python interpreter. This involves seting up an init.py, setup.py etc so that any script can use that package.