您的位置: 首页 > 文章 > 【Python】包、模块、函数与变量作用域 【Python】包、模块、函数与变量作用域 分类: 文章 • 2024-06-24 20:24:35 文章目录 包 __init__ 注意包和模块的导入注意 引用 自动生成 一个py文件(模块)可以写多个类 包 必须要有__init__.py包名 init init导入,会自动运行init 导入包下的变量也会自动运行init 初始化限制导入模块 c7 c8 init批量导入系统库 注意包和模块的导入注意 引用 c7c8c7如果在子包简化 导入具体变量 简化 批量导入 导入*代表的指定文件,只导入了ac导入指定数据一行80字符建议,换行\ 或者 () 自动生成 设置缓存文件夹不可见实际文件还是存在