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

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
主站蜘蛛池模板: 安阳市| 仲巴县| 冷水江市| 望奎县| 阜新市| 抚顺市| 吴旗县| 林州市| 门源| 镇雄县| 吉安市| 楚雄市| 长顺县| 固安县| 永平县| 福清市| 维西| 五华县| 务川| 龙游县| 巫溪县| 定兴县| 来安县| 彭州市| 福海县| 玉环县| 遂溪县| 丹寨县| 勃利县| 湖南省| 长葛市| 织金县| 永靖县| 运城市| 石楼县| 普陀区| 兴隆县| 彰化市| 洛川县| 申扎县| 枣阳市|