8.16 (day17) packets, time, datetime, os, sys, json, pickle, hashlib, hmac, logging module

package

Package is a form of a module, the packet is essentially a file containing the folder .py

Why packages?

With a package to expand the function module

How to pack?

.Py import package is introduced may be introduced in the package and the following two ways:

import

from import

Expansion module:

As if we need to expand aaa.py module, you need to create a catalog file aaa, and delete aaa.py file, aaa.py modified to m1.py and m2.py two files, make use of the function module does not change .

** ** modify __init__.py file

Encapsulated packet introduced

Guess you like

Origin www.cnblogs.com/jiann/p/11529040.html