Python Basics
1. Write in front
Recently, I have been learning python to summarize some of the thoughts and ideas that have been learned and learned, so as to make your knowledge logical structure appear clear and let yourself know more thoroughly. Given the limited level of learning, some ideas and thinking will remain in the future to achieve and solve.
I use the Python3.5 version again, so the Python standard library is referenced by the 3.5.2 version.
2. Coded layout
# 1. Start Line (Unix-like): The program with the starting line will enter the file name to run, no need to call the Python interpreter, write the absolute path of the file.
# 2. Module Documentation: A brief description of the function of the module, the meaning of the global variable.
# 3. Import module: Import all the modules required by the current module, the module will be imported only once, generated by the interpreter explained the file, specifically written to the module and then specific.
# 4. Variable definition: The variable defined here is a global variable, and the function in the module can be used directly.
# 5. Definition of class: All classes are defined here.
# 6. Function definition: The function defined here can be executed with module.function ().
# 7. Main function: This part of the code executes regardless of whether the module is imported or executed directly. This part of the main is to call different functions, write some logical code.
3. Coding basic Style annotations
Develop the habit of commenting, as concise as possible. Put it in the right place.
Document
There is a __doc__ variable in python that gets the text string. Run with obj.__doc__.
Python Learning record (Basic)