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

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
主站蜘蛛池模板: 宜宾县| 银川市| 江安县| 涞源县| 栖霞市| 潮州市| 遂川县| 读书| 霍城县| 永康市| 石城县| 镇雄县| 永胜县| 彩票| 彭州市| 丽江市| 凯里市| 从化市| 大港区| 老河口市| 宁南县| 县级市| 灵武市| 兴化市| 高平市| 那坡县| 南皮县| 鲁山县| 沅江市| 贡山| 大渡口区| 河北省| 铜川市| 宁强县| 西贡区| 崇文区| 城步| 建宁县| 囊谦县| 江北区| 蒲江县|