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

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
主站蜘蛛池模板: 崇礼县| 广宁县| 南川市| 青州市| 项城市| 辽宁省| 墨江| 临泽县| 潮安县| 杨浦区| 临洮县| 阿拉善右旗| 赣榆县| 炉霍县| 清水河县| 绥中县| 大余县| 康保县| 大同县| 集贤县| 马山县| 松江区| 铜陵市| 平乐县| 蒙阴县| 清镇市| 凤山市| 正定县| 林州市| 临沧市| 萝北县| 德钦县| 台南县| 郑州市| 磐石市| 镇远县| 南城县| 陇西县| 色达县| 长岭县| 丘北县|