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

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
主站蜘蛛池模板: 东港市| 颍上县| 澄迈县| 青州市| 西吉县| 新绛县| 吉林省| 玛多县| 锡林浩特市| 贵阳市| 石嘴山市| 巫溪县| 宣汉县| 正阳县| 隆安县| 遂川县| 邢台县| 红河县| 金门县| 锡林郭勒盟| 乌兰察布市| 定州市| 杭锦后旗| 祥云县| 南康市| 澄江县| 临猗县| 霍山县| 武胜县| 台中市| 本溪| 宿州市| 且末县| 平湖市| 彭州市| 崇左市| 万源市| 丰县| 石门县| 随州市| 冕宁县|