As I learned and worked with Python, I took quite a few notes, some of which WERE refined and published on my blog. With the increase of notes, I came up with the idea of writing a book, hoping to summarize relevant knowledge in a systematic way and consolidate my knowledge system instead of staying in the state of “feeling as if I have understood”.

Once you have an idea, the next step is to start writing. Of course, it takes a while to get from idea to practice. After all, note-taking is very different from writing a book. After struggling with my thoughts, I made up my mind to write it.

First of all, I made a basic mind map by referring to some relevant books as follows:

Then came the writing, which was the hardest part.

Instead of writing from beginning to end, I started with the topics I was most interested in, such as functional programming, using classes, and so on. In this way, bit by bit to write, really do not want to write, put aside for a while, after two days to continue to write.

In the process of writing, I set a requirement for myself: try to be simple and clear. As to whether it has been achieved, I hope readers can make criticisms and give me suggestions and suggestions.

Currently, the contents of the book are as follows (basically corresponding to the mind map above) :

  • Chapter 1: Covers the basics, including input and output, and character encoding in Python.
  • Chapter 2: Introduces common data types, such as strings, lists, and dictionaries.
  • Chapter 3: Introduces function definitions and function argument magic.
  • Chapter 4: Introduces functional programming in Python, including anonymous functions, closures, and decorators.
  • Chapter 5: Introduces the use of classes in Python, such as class methods, the use of metaclasses, etc.
  • Chapter 6: Introduces advanced Python features, such as generators and context managers.
  • Chapter 7: Introduces file and directory operations, using OS.
  • Chapter 8: Introduces processes, threads, and coroutines using Python.
  • Chapter 9: Exception handling.
  • Chapter 10: Unit testing.
  • Chapter 11: Regular expressions, use of the RE module.
  • Chapter 12: Use of the HTTP service, Requests module.
  • Chapter 13: Use of standard modules such as Argparse, Collections, etc.
  • Chapter 14: Use of some third party modules.
  • Chapter 15: Concluding remarks.

The coding environment of this book:

  • The Python version is dominated by 2.7, and changes in Python3 will also be indicated
  • Operating systems using macOS, code results, especially memory addresses, can vary depending on the operating environment

Finally, attach the book address: GitHub address.

Thank you very much!