Skip to content

Commit

Permalink
Merge pull request yidao620c#209 from fanofxiaofeng/patch-7
Browse files Browse the repository at this point in the history
目录结构似乎有点问题
  • Loading branch information
yidao620c authored Nov 30, 2017
2 parents 17b210d f1940b3 commit 83ae29b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/c10/p01_make_hierarchical_package_of_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 40,7 @@
----------
定义模块的层次结构就像在文件系统上建立目录结构一样容易。
文件__init__.py的目的是要包含不同运行级别的包的可选的初始化代码。
举个例子,如果你执行了语句import graphics, 文件graphics/__init__.py将被导入,建立graphics命名空间的内容。像import graphics.format.jpg这样导入,文件graphics/__init__.py和文件graphics/graphics/formats/__init__.py将在文件graphics/formats/jpg.py导入之前导入。
举个例子,如果你执行了语句import graphics, 文件graphics/__init__.py将被导入,建立graphics命名空间的内容。像import graphics.format.jpg这样导入,文件graphics/__init__.py和文件graphics/formats/__init__.py将在文件graphics/formats/jpg.py导入之前导入。


绝大部分时候让__init__.py空着就好。但是有些情况下可能包含代码。
Expand Down

0 comments on commit 83ae29b

Please sign in to comment.