模块 Modules
def bark():
print("woof!")
import dog
from dog import bark
dog.bark() # "woof!"
bark() # "woof!"
Create lib folder

def bark():
print("woof!")
from lib import dog
from lib.dog import bark
dog.bark() # "woof!"
bark() # "woof!"
Buit-in modules
mathfor math utilitiesrefor regular expressionsjsonto work with JSON datetime to work with dates sqlite to use SQLiteosfor Operating System utilitiesrandomfor random number generationstatisticsfor statistics utilities requests to perform HTTP network requestshttpto create HTTP serversurllibto manage URLS
import math
from math import sqrt
math.sqrt(4) # 2.0
sqrt(4) # 2.0