pythonbook/Python 基础教程/package/syu/moduleTest.py

17 lines
348 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 一个.py文件就称为一个模块
# 方式一import 模块名
import module
module.output()
# 方式二 :from 模块名 import 函数名
from module import output
output()
# 方式三: from 模块名 import *
from module import *
output()
# 方式四:from 模块名 import 函数名 as tt(自定义)
from module import output as tt
tt()