python learning Notes (2): set the project directory and import

Use as an absolute position in the large-scale project is the first prerequisite. For a separate project, to pursue all manner of modules, it is best to start from the root directory of the project traceability, which is called relative, absolute path.

Following advantages:

  • Simplify dependency management. The entire company code modules, can be called by any program you write, while you write libraries and modules can also be called by other people. Way calling, are starting index from the root directory of the code, which is mentioned earlier relative absolute path. This greatly improves the ability to share a common code, you do not need to repeat create the wheel, just before writing, to search out if there is a good package has been achieved or frame it.
  • Unified version. There is no use of a new module, but lead to the collapse of a series of functions; and all upgrades are required before you can continue by unit tests.
  • Code retroactive. You can easily traceable, from where an API is called, its version of history is how iterative development, produce change.
    Here Insert Picture Description

source

  • https://cacm.acm.org/magazines/2016/7/204032-why-google-stores-billions-of-lines-of-code-in-a-single-repository/fulltext
  • Python core technology and combat
Published 82 original articles · won praise 82 · views 240 000 +

Guess you like

Origin blog.csdn.net/uncle_ll/article/details/102914284