官术网_书友最值得收藏!

Creating an empty package

The first section of this chapter deals with creating a simple empty package, which won't do anything yet, but by the time we're done, we'll be able to import the empty package into the Python shell.

Simple Python projects may consist of a single code module, but normally there are multiple modules combined together into a package. A package can contain as many modules as we need it to. Packages start their lives as folders on the filesystem, which means we can make them just as we would make any other folder.

If you prefer to use your operating system's file browser to make folders, that's fine, but I usually use the command line. For example let's run a demo package:

$ mkdir demopackage

This is shown as the following screenshot:

主站蜘蛛池模板: 北海市| 赣榆县| 崇明县| 长沙市| 都兰县| 永康市| 临潭县| 杨浦区| 崇明县| 兰西县| 沂水县| 呼伦贝尔市| 汉沽区| 周口市| 黎平县| 中西区| 满洲里市| 新建县| 宁明县| 自贡市| 北票市| 杭锦旗| 奉贤区| 柳林县| 阿瓦提县| 广西| 湖南省| 蕉岭县| 鹤山市| 方城县| 龙井市| 巴彦淖尔市| 逊克县| 博客| 石泉县| 乐安县| 张家口市| 舞阳县| 建水县| 克山县| 洛川县|