python initialization

When we create a python, ide tools tend to create a _init_.py, then this document in the end what role it?

From the file naming point of view, we will say that this have to ask, is certainly initialization ah

Initialization is certainly not wrong, in the end this place can do what?

1, the package required dependencies introduced following package python

      Doing the project, a lot of the time you define a variable, at compile time, tend to forget sometimes lead pack, even if you need to import a lot of time to import a lot of packages

   If this time you import into a place, you do not need each file imported

 Inside there is this effect of variable _all_

2, easy to post-maintenance

    If you do a project maintained, many times you will think: This garbage code, who wrote! Look at the code, see both a headache dead, inside my mind first thought is

   Want to delete it, reconstruct it down himself. For example, you have done C ++ projects, Has anyone encountered repeated rely too far file, the compiler always being given, then a file in turn depends on another file,

  Another document repeated reliance, as has snarled, need to slowly find. There are bigger when you project, you do not know, your modified file will not affect the other companions,

Pointer abuse, parameter by value if you do not control the effects are often disastrous.

        If this time, there is a package below, you need to import only once, all file types can be used, when maintained, if the problem lead pack, go directly to the file below,

Totally ignore other files, greatly speeding up the troubleshooting efficiency.

Guess you like

Origin www.cnblogs.com/king258/p/11220428.html