feat(python进阶): 新增模块与包课程

This commit is contained in:
2026-08-03 21:26:53 +08:00
parent 42baf5d317
commit 691405f380
7 changed files with 562 additions and 7 deletions

View File

@@ -0,0 +1,4 @@
# 这个文件表示 agent_package 是一个 Python 包。
#
# 包就是用于组织多个模块的文件夹。
# 目前先保留简单注释,后续课程会继续学习更复杂的包结构。

View File

@@ -0,0 +1,9 @@
# 第 2-1 课示例:包中的模块
def get_status_text(enabled):
"""把布尔值状态转换成中文文本。"""
if enabled:
return "启用"
return "停用"