[Cover] (https://ofaatpail.qnssl.com/2017-01-03-explore-python-cover.png)
Introduction to Python
Python was born in the Christmas of 1989 and was developed by [Guido van Rossum] (https://gvanrossum.github.io/). Currently, Guido is still the main developer of Python, leading the development of Python, the Python community Often referred to as "benevolent dictator."
Python is an object-oriented, interpreted high-level programming language, its syntax is very simple, elegant, and this is some of Python's design philosophy. Python comes with a very comprehensive library, covering the database, network, file processing, GUI and other aspects, through these libraries, we can quickly solve some difficult problems, can also be used as a basic library, the development of some advanced libraries.
At present, Python has a place in most areas, such as Web development, machine learning, scientific computing. Many large sites use Python as a backend language, such as [YouTube] (https://www.youtube.com/), [Pinterest] (https://www.pinterest.com/), domestic [ (Http: // www.douban.com/) and [know almost] (http://www.zhihu.com/) and so on. In addition, there are many well-known machine learning library is also developed using Python, for example, [scikit-learn] (http://scikit-learn.org/stable/) is a powerful machine learning library, [Theano] (https : //github.com/Theano/Theano) is a mature depth learning library.
Of course, Python also has some drawbacks. One of the things that Python often teaches is that it runs slowly and is very slow compared to C / C ++. However, in addition to high-definition decoding such as video ** intensive computing tasks ** have a higher speed requirements, in most of the time, we may not need very fast running speed. For example, a program that uses C to achieve, running time only 0.01 seconds, and the use of Python to achieve, take 0.1 seconds, although the Python run time is C 10 times, obviously slow, but for us, this is not problem.
This book is my summary of learning and using Python. In the process of learning and using Python, I made a lot of notes, and some of the notes were processed and improved, published in the blog. With the increase of notes, I started to write a book idea, hoping to more systematically sum up the relevant knowledge, consolidate their knowledge system, rather than stay in the "feel like understanding" state.
With the idea, the next will begin to write. Of course, from the generation of ideas to put into practice or tangled up for some time, after all, for writing and writing a book is not the same ah. After the ideological struggle, I am determined to write it out.
First of all, I made reference to a number of related books, made a basis for the mind map, as follows:
[Mind Map] (https://ofaatpail.qnssl.com/2017-01-03-explore-python2.png)
Next, we must start writing, and this is the most difficult hurdle.
I did not write from the beginning to the end, but from the most interesting knowledge of the points, such as functional programming, the use of such categories. In this way, little by little to write, really do not want to write, to shelve about two days to write.
I am in the process of writing, to mention their own requirements: ** as easy to explain in simple terms, structured clarity **. As to whether it has been achieved, I hope readers will criticize a lot of corrections, and give me comments and suggestions.
Each chapter of the book is basically independent, the reader can select the chapters of interest to read. There are currently 15 chapters in this book:
- Chapter 1: Introduction to some of the basics, including Python in the input and output, character encoding.
- Chapter 2: Introduction to common data types, such as strings, lists and dictionaries.
- Chapter 3: Introduction to the definition of function and function parameters magic.
- Chapter 4: Introduction to functional programming in Python, including anonymous functions, closures and decorators.
- Chapter 5: Introduction to the use of classes in Python, including class methods, static methods, super and meta-class use.
- Chapter 6: Introducing advanced features in Python, such as builders and context managers.
- Chapter 7: Introduction to file and directory operations, os use.
- Chapter 8: Describe the use of Python to handle processes, threads, and coroutines.
- Chapter 9: Exception Handling.
- Chapter 10: Unit Testing.
- Chapter 11: Regular Expressions, re-use of the module.
- Chapter 12: HTTP Services, the use of the requests module.
- Chapter 13: The use of some standard modules, such as argparse, collections and datetime and so on.
- Chapter 14: Use of some third-party modules.
- Chapter 15: Conclusion.
The coding environment of this book:
- Python version 2.7 to the main, but also pointed out that the corresponding changes in Python3
- operating system using macOS, the code results, especially the memory address, etc. due to differences in the operating environment will be different
This book will continue to be revised and updated, the reader in case of problems, please give me feedback, I will be the first time to be addressed.
Currently epub format electronic version of the book, because the generated pdf and mobi version is not very beautiful, is not conducive to reading, it is not provided.
[Download epub version] (https://github.com/ethan-funny/explore-python/raw/master/explore-python.epub)
This book was written by [Ethan] (https://github.com/ethan-funny) using [CC BY-NC-ND 4.0] (https://creativecommons.org/licenses/by-nc-nd/4.0/ Deed.zh) agreement issued.
This means that you can use the premise of non-commercial free reprint, but must:
- Keep your signature
- Do not modify this book
Time | Description | |: ---: |: ---: | | 2017-01-03 | Releases v1.0 |
If you have any suggestions or comments on this book, please criticize and correct me, and contact me.
- [Personal Home] (https://funhacks.net)
- [GitHub] (https://github.com/ethan-funny)
- [Twitter] (https://twitter.com/pihacks)
If you find this book helpful, ask me for a cup of coffee and thank you for your support!