Quick to learn a new module

1, the module name .__ doc__ profile view function, for ease of viewing, using print (module name .__ doc__) printed, the format for easy viewing.

2, using the built-in method dir () variable view modules, functions, classes, and so on; a "module name .__ all__" to see all things from the outside using the modules available to.

  Note: 1, not all modules are "__all__" property

     2, the use of "from the name of the module import *" mode when importing way, if there is "__alll__ Properties" module, only the "module name .__ all__" enumerated import the namespace name; if there is no "__all__" property, it will not import all of the namespace with the name beginning with an underscore.

     3, "__ file__" Properties "module name .__ file__" will indicate the location where the source code,

 

Guess you like

Origin www.cnblogs.com/Chris-01/p/11240269.html