程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> Python >> learning python部分介紹

learning python部分介紹

編輯:Python

Part I
We begin with a general overview of Python that answers commonly asked initial
questions—why people use the language, what it’s useful for, and so on. The first
chapter introduces the major ideas underlying the technology to give you some
background context. The rest of this part moves on to explore the ways that both
Python and programmers run programs. The main goal here is to give you just
enough information to be able to follow along with later examples and exercises.

第一部分
我們首先概述常見初始Python的答案
問題為什麼人們使用語言,什麼是有用的,等等。第一個
章主要介紹了底層的技術給你一些想法
背景語境。剩下的這部分繼續探索的方式
Python和程序員運行程序。這裡的主要目的是給你
足夠的信息能夠跟隨後來例子和練習。

Part II
Next, we begin our tour of the Python language, studying Python’s major built-in
object types and what you can do with them in depth: numbers, lists, dictionaries,
and so on. You can get a lot done with these tools alone, and they are at the heart
of every Python script. This is the most substantial part of the book because we lay
groundwork here for later chapters. We’ll also explore dynamic typing and its
references—keys to using Python well—in this part.

第二部分
接下來,我們開始參觀Python語言,學習Python的內置
對象類型,你能做什麼和他們在深度:數字、列表、字典、
等等。你可以用這些工具完成很多,和他們的心
每一個Python腳本。這是這本書最重要的部分,因為我們
這為以後章節奠定基礎。我們還將探索動態類型及其
references-keys使用Python——這部分。

Part III
The next part moves on to introduce Python’s statements—the code you type to
create and process objects in Python. It also presents Python’s general syntax
model. Although this part focuses on syntax, it also introduces some related tools
(such as the PyDoc system), takes a first look at iteration concepts, and explores
coding alternatives.

第三部分
下一部分將介紹了Python的陳述中代碼類型
在Python中創建和處理對象。它還介紹了Python的一般語法
模型。雖然這部分側重於語法,還介紹了一些相關的工具
(如PyDoc系統),首先需要看看迭代概念和探索
編碼方案。

Part IV
This part begins our look at Python’s higher-level program structure tools. Func-
tions turn out to be a simple way to package code for reuse and avoid code redun-
dancy. In this part, we will explore Python’s scoping rules, argument-passing tech-
niques, the sometimes-notorious lambda, and more. We’ll also revisit iterators
from a functional programming perspective, introduce user-defined generators,
and learn how to time Python code to measure performance here.第四部分
這一部分開始我們看看Python的高級程序結構的工具。Func -
規劃設計是一種簡單的方式來包裝代碼重用,避免代碼redun -
dancy。在本部分中,我們將探索Python的范圍規則,參數傳遞技術
種,sometimes-notoriousλ,等等。我們也會重新迭代器
從函數式編程的角度來看,引入用戶定義的發電機,
和學習時間Python代碼度量性能。

Part V
Python modules let you organize statements and functions into larger components,
and this part illustrates how to create, use, and reload modules. We’ll also look at
some more advanced topics here, such as module packages, module reloading,
package-relative imports, 3.3’s new namespace packages, and the  __name__ vari-
able.

第五部分
Python模塊允許您聲明和功能組織成更大的組件,
這部分說明了如何創建、使用和重新加載模塊。我們也會看
一些更高級的主題,比如模塊包、模塊重新加載,
package-relative進口,3.3的新的名稱空間包,__name__變化-
可以。

Part VI
Here, we explore Python’s object-oriented programming tool, the class—an op-
tional but powerful way to structure code for customization and reuse, which al-
most naturally minimizes redundancy. As you’ll see, classes mostly reuse ideas we
will have covered by this point in the book, and OOP in Python is mostly about
looking up names in linked objects with a special first argument in functions. As
you’ll also see, OOP is optional in Python, but most find Python’s OOP to be much
simpler than others, and it can shave development time substantially, especially
for long-term strategic project development.

第六部分
在這裡,我們探索Python的面向對象的編程工具,類成為op -
但強大的結構代碼的方法方面對定制和重用,al -
最自然最小化冗余。如您所見,類主要是重用我們的想法
將會由這一點在書中,和OOP在Python中主要是什麼
查找名稱鏈接對象通過一個特殊的函數的第一個參數。作為
您還將看到,OOP在Python中是可選的,但大多數找到Python的OOP得多
比其他人更簡單,它可以大大節省開發時間,特別是
為長期戰略項目的發展。

Part VII
We conclude the language fundamentals coverage in this text with a look at
Python’s exception handling model and statements, plus a brief overview of de-
velopment tools that will become more useful when you start writing larger pro-
grams (debugging and testing tools, for instance). Although exceptions are a fairly
lightweight tool, this part appears after the discussion of classes because user-de-
fined exceptions should now all be classes. We also cover some more advanced
topics, such as context managers, here.

第七部分
我們結束這個文本的語言基礎覆蓋一看
Python的異常處理模型和語句,加上de -簡要概述
章工具將變得更加有用,當你開始寫更大的支持
克(調試和測試工具,例如)。盡管異常是一個相當
輕量級的工具,這部分討論後出現因為user-de——類
現在應該是所有類罰款異常。我們也討論一些更高級的
話題,如環境經理。

Part VIII
In the final part, we explore some advanced topics: Unicode and byte strings,
managed attribute tools like properties and descriptors, function and class deco-
rators, and metaclasses. These chapters are all optional reading, because not all
programmers need to understand the subjects they address. On the other hand,
readers who must process internationalized text or binary data, or are responsible
for developing APIs for other programmers to use, should find something of in-
terest in this part. The examples here are also larger than most of those in this book,
and can serve as self-study material.

第八部分
在最後一部分中,我們探索一些高級主題:Unicode字符串和字節,
管理工具屬性和屬性描述符、函數和類裝飾-
rators,元類。閱讀這些章節都是可選的,因為並不是所有的
程序員需要了解受試者他們地址。另一方面,
讀者必須處理國際化文本或二進制數據,或者是負責任的
為其他程序員開發api使用,應該在,找到的東西
特雷在這部分。的例子也比大多數在這本書中,
和可以作為自學材料。

Part IX
The book wraps up with a set of four appendixes that give platform-specific tips
for installing and using Python on various computers; present the new Windows
launcher that ships with Python 3.3; summarize changes in Python addressed by
recent editions and give links to their coverage here; and provide solutions to the
end-of-part exercises. Solutions to end-of-chapter quizzes appear in the chapters
themselves.
See the table of contents for a finer-grained look at this book’s components.

第九部分
這本書將一組四個附錄,給特定於平台的建議
不同的電腦上安裝和使用Python;現在的新窗口
發射器,附帶Python 3.3;總結變化在Python中解決
最近的版本和給他們的報道鏈接,並提供解決方案
一部分的最後練習。章測試解決方案出現在章節
他們自己。
看到桌子上的內容更細粒度的看看這本書的組件。

It’s Not a Reference or a Guide to Specific Applications
This book is a language tutorial, not a reference, and not an applications book. This is
by design: today’s Python—with its built-in types, generators, closures, comprehen-
sions, Unicode, decorators, and blend of procedural, object-oriented, and functional
programming paradigms—makes the core language a substantial topic all by itself, and
a prerequisite to all your future Python work, in whatever domains you pursue. When
you are ready for other resources, though, here are a few suggestions and reminders:
Reference resources
As implied by the preceding structural description, you can use the index and table
of contents to hunt for details, but there are no reference appendixes in this book.
If you are looking for Python reference resources (and most readers probably will
be very soon in their Python careers), I suggest the previously mentioned book that
I also wrote as a companion to this one—Python Pocket Reference—as well as other
reference books you’ll find with a quick search, and the standard Python reference
manuals maintained at http://www.python.org. The latter of these are free, always
up to date, and available both on the Web and on your computer after a Windows
install.

這不是一個參考或指導特定的應用程序
這本書是一個語言教程中,沒有一個參考,不是一個應用程序的書。這是
通過設計:今天的Python-with內置類型,發電機,閉包,綜合-
錫安,Unicode、修飾符和混合程序,面向對象和功能
編程paradigms-makes核心語言大量主題本身,和
你未來的Python所有工作的前提,在你追求的任何領域。當
你准備好其他資源,這裡有一些建議和提醒:
參考資源
之前所隱含的結構描述,您可以使用索引和表
尋找的內容細節,但這本書中沒有參考附錄。
如果你正在尋找Python參考資源(和大多數讀者可能會
很快在Python職業),我建議前面提到的書
我還寫了一個同伴一集python口袋引用,因為和其他
參考書與快速搜索,你會發現,和標准的Python參考
在http://www.python.org維護手冊。這些是免費的,後者總是
日期,可以在網絡上和窗口後在您的計算機上
安裝。

 

But if your time is tight: Though depth is crucial to mastering Python,
some readers may have limited time. If you are interested in starting out
with a quick Python tour, I suggest Chapter 1, Chapter 4, Chapter 10,
and Chapter 28 (and perhaps 26)—a short survey that will hopefully
pique your interest in the more complete story told in the rest of the
book, and which most readers will need in today’s Python software
world. In general, this book is intentionally layered this way to make its
material easier to absorb—with introductions followed by details, so
you can start with overviews, and dig deeper over time. You don’t need
to read this book all at once, but its gradual approach is designed to help
you tackle its material eventually.

但是,如果你的時間很緊:雖然深度掌握Python是至關重要的,
有些讀者可能已經有限的時間。如果你感興趣的開始
快速Python之旅,我建議第一章,第四章,第十章,
26和28章(或許)——一個簡短的調查,將有希望
激起您的興趣在更完整的故事的其余部分
書,大多數讀者將需要在今天的Python軟件
世界。總的來說,這本書是故意使其分層的這種方式
材料容易absorb-with介紹細節,緊隨其後
你可以從概述開始,隨著時間的推移和深入。你不需要
讀這本書,但其漸進的方式旨在幫助
最終你解決它的材料。Python Versions
This fifth edition of this book, and all the program examples in it, are based on Python
versions 3.3 and 2.7. In addition, many of its examples run under prior 3.X and 2.X
releases, and notes about the history of language changes in earlier versions are mixed
in along the way for users of older Pythons.
Because this text focuses on the core language, however, you can be fairly sure that
most of what it has to say won’t change very much in future releases of Python, as noted
earlier. Most of this book applies to earlier Python versions, too, except when it does
not; naturally, if you try using extensions added after a release you’re using, all bets are
off. As a rule of thumb, the latest Python is the best Python if you are able to upgrade.
Because this book focuses on the core language, most of it also applies to both Jython
and IronPython, the Java- and .NET-based Python language implementations, as well
as other Python implementations such as Stackless and PyPy (described in Chapter 2).
Such alternatives differ mostly in usage details, not language.

這這本書的第五版,所有程序例子,基於Python
版本3.3和2.7。此外,它的許多例子在前3下運行。倍和2.倍
釋放,指出語言的歷史早期版本混合的變化
在老用戶的蟒蛇。
因為本文著重於核心語言,然而,你可以相當肯定
大多數的說不會改變在未來版本的Python,如上所述
早些時候。這本書的大部分適用於早期的Python版本,除非它
,當然,如果你試著用擴展添加發布你使用後,所有的賭注
了。作為一個經驗法則,最新的Python Python是最好的如果你能升級。
因為這本書關注的核心語言,它也適用於Jython
IronPython和Java和。在網店Python語言實現
其他如Stackless Python實現和PyPy(第二章中描述)。
這樣的替代方案的主要區別在於使用的細節,而不是語言。

Fetching This Book’s Code
Source code for the book’s examples, as well as exercise solutions, can be fetched as a
zip file from the book’s website at the following address:
http://oreil.ly/LearningPython-5E
This site includes both all the code in this book as well as package usage instructions,
so I’ll defer to it for more details. Of course, the examples work best in the context of
their appearance in this book, and you’ll need some background knowledge on running
Python programs in general to make use of them. We’ll study startup details in Chap-
ter 3, so please stay tuned for information on this front.

取這本書的代碼
書的例子的源代碼,以及運動解決方案,可以作為提取
zip文件從這本書的網站在以下地址:
http://oreil.ly/LearningPython-5E
這個網站包括在這本書的所有代碼包使用說明,
所以我聽從了更多的細節。當然,這個例子最好的環境中工作
外表在這本書中,你會需要一些背景知識在運行
Python程序通常使用他們。我們將研究啟動章-細節
後3,所以請請繼續關注這方面的信息。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved