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

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:

主站蜘蛛池模板: 江山市| 托克逊县| 桑日县| 呼玛县| 长乐市| 辛集市| 宣武区| 乌兰浩特市| 嘉荫县| 宜兰县| 马龙县| 富源县| 大余县| 托克逊县| 康定县| 林甸县| 八宿县| 大石桥市| 页游| 钦州市| 鱼台县| 化州市| 元谋县| 怀来县| 巴彦淖尔市| 云安县| 高陵县| 绥宁县| 留坝县| 义乌市| 天峨县| 射洪县| 博乐市| 舒兰市| 临汾市| 江津市| 江都市| 平顶山市| 广南县| 蒲江县| 怀集县|