Python module vs library

T

Terry Jan Reedy

Hi, what is the difference between python module and library ?

They are in different categories. A Python module is a namespace (a
mapping of names to objects) created by running Python code as a main
module or by import statements within Python code (or by executing
import functions within a Python interpreter). A library in general is a
collection of functions and classes used by multiple applications. A
Python library is composed of Python modules, packages, and collections
of such.
 
M

Michael Torrie

Hi, what is the difference between python module and library ?

"library" doesn't really mean anything specifically to Python's
interpreter. It's not a valid keyword and is only used by humans to
describe the abstract function and nature of a bunch of arbitrary Python
code, usually in a module or library.

Python does have a concept of modules and packages. Both serve the same
purpose, which is to bring together a collection of attributes into a
namespace that can be imported into the current namespace (IE a library!).
 
R

rusi

"library" doesn't really mean anything specifically to Python's
interpreter.  It's not a valid keyword and is only used by humans to
describe the abstract function and nature of a bunch of arbitrary Python
code, usually in a module or library.

I guess Michael meant "...module or package."
Else the next question is going to be "Can you explain recursion in
python?" :)
 
M

Michael Torrie

I guess Michael meant "...module or package."
Else the next question is going to be "Can you explain recursion in
python?" :)

You're right. On both counts. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top