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

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:

主站蜘蛛池模板: 兰州市| 郧西县| 滨海县| 洞头县| 泰顺县| 虞城县| 洪湖市| 乐昌市| 石台县| 沽源县| 同仁县| 宁津县| 芜湖市| 会宁县| 墨玉县| 神池县| 翁源县| 凉山| 鹿邑县| 绥宁县| 礼泉县| 阜城县| 东兰县| 仁化县| 远安县| 昌乐县| 读书| 娄底市| 玉山县| 天峨县| 开化县| 克什克腾旗| 永仁县| 汉寿县| 涪陵区| 满城县| 安国市| 漳浦县| 衡水市| 阳东县| 潍坊市|