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

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:

主站蜘蛛池模板: 武川县| 通海县| 霍山县| 和平区| 枣庄市| 南开区| 靖边县| 临安市| 正安县| 邻水| 申扎县| 赣榆县| 星座| 余江县| 旌德县| 新巴尔虎右旗| 工布江达县| 大同县| 孟州市| 武川县| 莆田市| 绥芬河市| 元谋县| 梅河口市| 苍溪县| 安福县| 平邑县| 湘潭市| 中阳县| 酒泉市| 新野县| 安新县| 临夏市| 洛浦县| 大理市| 唐山市| 思茅市| 吴忠市| 博罗县| 玛纳斯县| 定边县|