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

Basic Best Practices

In the previous chapter, we saw how to put together a Python package of code and data. In this chapter, we're going to look at some rather simple things we can do that will make our lives as Python programmers simpler overall. We'll switch gears and look at version control, which will help us to collaborate with other programmers and serve as an undo buffer for the whole lifetime of a project. We're going to look at Python's built-in virtual environment tool, venv, which allows us to keep our programs and dependencies separate from each other and the software installed on our overall system.

You'll learn how to structure our docstrings for maximum utility, how to add Rich Text formatting to them, and how to export them into hyperlinked HTML documentation for viewing in a web browser. You'll also see one more cool advantage we can get from docstrings by actually executing the examples we include in our documentation and making sure they agree with what the code actually does.

In this chapter, we'll cover the following topics:

  • PEP 8 and writing readable code
  • Using version control
  • Using venv to create a stable and isolated work area
  • Getting the most out of docstrings
主站蜘蛛池模板: 定南县| 固始县| 淮安市| 龙井市| 兰考县| 榆树市| 沂南县| 德令哈市| 容城县| 洱源县| 辽源市| 友谊县| 大兴区| 六盘水市| 云南省| 仙居县| 剑川县| 瓦房店市| 德庆县| 南阳市| 富平县| 雷山县| 潞西市| 上饶县| 明水县| 陆河县| 尤溪县| 揭阳市| 溆浦县| 胶南市| 崇明县| 房山区| 黎川县| 秦皇岛市| 保山市| 聊城市| 漳平市| 申扎县| 石柱| 万宁市| 镇平县|