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

Making a Package

In the previous chapter, we saw how to install Python and third-party packages of code that we can use with Python. In this chapter, we'll see how packages are represented on the computer's filesystem. We'll take a look at how to add code modules inside the package, how to make those code modules interact with each other within the package, and how to access data from non-code files that are incorporated into our package.

By the end of this chapter, you'll have a pretty good idea about how to create your own packages of Python code. Packages will form the basis for programs and help you to make your code modular.

In this chapter, we will cover the following topics:

  • Creating an empty package
  • Adding modules to the package
  • Accessing code from other modules
  • Adding static data files to the package
主站蜘蛛池模板: 穆棱市| 彰武县| 浮山县| 白沙| 南溪县| 修文县| 利津县| 金山区| 喀什市| 抚顺市| 邛崃市| 达拉特旗| 凤冈县| 搜索| 乐业县| 伊春市| 黄大仙区| 吕梁市| 樟树市| 江山市| 且末县| 玉环县| 石狮市| 来安县| 龙南县| 隆回县| 黔西| 五大连池市| 小金县| 宕昌县| 新营市| 大丰市| 保亭| 从江县| 峡江县| 海兴县| 禄丰县| 鄢陵县| 神木县| 丰都县| 宝清县|