Python Libraries Flashcards
1
Q
what are libraries used for
A
sharing and re-using code among different programs
2
Q
what is the difference between functions and libraries
A
libraries re-use code among different programs and functions within the same program
3
Q
what are the two types of Python libraries
A
module and package
4
Q
what is a module
A
a file that contains definitions and statements
5
Q
what is a package
A
collection of modules in a hierarchy
6
Q
does module need to be a program
A
no
7
Q
what a module can contain
A
for example: classes, variables, functions
8
Q
what is an entry point
A
if __name__ == “__main__”:
9
Q
is module entry point executed upon import
A
no
10
Q
in Linux where can you change PYTHONPATH
A
.bashrc
11
Q
what is needed in each package folder
A
__init__.py file