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

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
主站蜘蛛池模板: 沁水县| 苗栗市| 宜兰县| 宁南县| 平利县| 南投市| 普兰县| 东港市| 搜索| 华阴市| 喜德县| 高安市| 胶州市| 伊金霍洛旗| 林口县| 灌云县| 翁牛特旗| 清苑县| 志丹县| 保定市| 灵台县| 青岛市| 滕州市| 当涂县| 体育| 阿克苏市| 九龙县| 卢龙县| 沂源县| 罗城| 万载县| 荥经县| 玉田县| 武强县| 郴州市| 玉龙| 乌拉特前旗| 锦州市| 新泰市| 渑池县| 通江县|