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

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:

主站蜘蛛池模板: 南华县| 余庆县| 开江县| 佳木斯市| 建宁县| 蓬安县| 嘉黎县| 沾化县| 沈阳市| 桐城市| 桐庐县| 松江区| 永城市| 达拉特旗| 天门市| 延津县| 张家川| 谷城县| 当雄县| 宜都市| 遂川县| 无棣县| 莱西市| 镇原县| 车险| 扬中市| 资中县| 视频| 高阳县| 土默特左旗| 灵宝市| 中西区| 枞阳县| 麦盖提县| 十堰市| 交城县| 喀喇| 梨树县| 忻州市| 维西| 蒙自县|