modules, packages, libraries, frameworks

发布时间 2023-12-01 11:55:55作者: shendawei

module

A module is basically a bunch of related code saved in a** file** with the extension** .py**.

package

A package is basically a directory of a collection of modules.
To be considered a package (or subpackage), a directory must contain a file named init.py.

library

torch, matplotlib, numpy...
库和包没有严格的区分,因为包也可以包含多个子包。

A package is a collection of modules, a library is a collection of packages.

framework

Django, Flask

Frameworks are usually more complex than libraries. Also, while libraries contain packages that perform specific operations, frameworks contain the basic flow and architecture of the application.