Название: Python Tutorial Автор: Bernd Klein Издательство: Bodenseo Год: 2021 Страниц: 610 Язык: английский Формат: pdf Размер: 19.6 MB
So, what about the name "Python"? Most people think about snakes, and even the logo depicts two snakes, but the origin of the name has its root in British humour. Guido van Rossum, the creator of Python, wrote in 1996 about the origin of the name of his programming language: "Over six years ago, in December 1989, I was looking for a 'hobby' programming project that would keep me occupied during the week around Christmas. My office ... would be closed, but I had a home computer, and not much else on my hands. I decided to write an interpreter for the new scripting language I had been thinking about lately: a descendant of ABC that would appeal to Unix/C hackers. I chose Python as a working title for the project, being in a slightly irreverent mood (and a big fan of Monty Python's Flying Circus)."
In October 2000, Python 2.0 was introduced. This release included list comprehensions, a full garbage collector and it was supporting unicode. Python flourished for another 8 years in the versions 2.x before the next major release as Python 3.0 (also known as "Python 3000" and "Py3K") was released. Python 3 is not backwards compatible with Python 2.x. The emphasis in Python 3 had been on the removal of duplicate programming constructs and modules, thus fulfilling or coming close to fulfilling the 13th law of the Zen of Python: "There should be one -- and preferably only one -- obvious way to do it."
But, as we said at the beginning, we want to write a "serious" program now, i.e. a program which resides in a file. This way, we can use a program over and over again without having to type it in again. Some may like to call such a little program "script". We will use a slight variation of the "Hello World" theme. We have to include our print function into a file. To save and edit our program in a file we need an editor. There are lots of editors, but you should choose one, which supports syntax highlighting and indentation. For Linux you can use vi, vim, emacs, geany, gedit and umpteen others. The Emacs works for Windows as well, but Notepad++ may be the better choice in many cases. Of course, you can also use an IDE (Integrated Development Environment) like PyCharm or Spyder for this purpose.
Contents: Strings............10 Execute a Python script .........11 Start a Python program........12 Loops .................136 Iterators and Iterables .............150 Coffee, Dictionary and a Loop ..........171 Parameters and Arguments..........226 Global, Local and nonlocal Variables........237 Regular Expressions ........304 Lambda, filter, reduce and map .........339 content of test_foobar.py ...........427 Deeper into Properties ...........481 Descriptors.............486 Multiple Inheritance: Example............534 Polynomials ............569 Metaclasses ............596 Count Method Calls Using a Metaclass ..........601 Abstract Classes ..........606
Внимание
Уважаемый посетитель, Вы зашли на сайт как незарегистрированный пользователь.
Мы рекомендуем Вам зарегистрироваться либо войти на сайт под своим именем.
Информация
Посетители, находящиеся в группе Гости, не могут оставлять комментарии к данной публикации.