亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? appendix_a.txt

?? 很詳細的Python文字處理教程
?? TXT
?? 第 1 頁 / 共 5 頁
字號:
  THIS IS ENDMATTER

APPENDIX -- A Selective and Impressionistic Short Review of Python
-------------------------------------------------------------------

  A reader who is coming to Python for the first time would be well
  served reading Guido van Rossum's _Python Tutorial_, which can be
  downloaded from <http://python.org/>, or picking up one of the
  several excellent books devoted to teaching Python to novices. As
  indicated in the Preface, the audience of this book is a bit
  different.

  The above said, some readers of this book might use Python only
  infrequently, or not have used Python for a while, or may be
  sufficiently versed in numerous other programming languages, that
  a quick review on Python constructs suffices for understanding.
  This appendix will briefly mention each major element of the
  Python language itself, but will not address any libraries (even
  standard and ubiquitous ones that may be discussed in the main
  chapters). Not all fine points of syntax and semantics will be
  covered here, either. This review, however, should suffice for a
  reader to understand all the examples in this book.

  Even readers who are familiar with Python might enjoy skimming
  this review. The focus and spin of this summary are a bit
  different from most introductions. I believe that the way I
  categorize and explain a number of language features can
  provide a moderately novel--but equally accurate--perspective
  on the Python language. Ideally, a Python programmer will come
  away from this review with a few new insights on the familiar
  constructs she uses every day.  This appendix does not shy
  away from using some abstract terms from computer science--if
  a particular term is not familiar to you, you will not lose
  much by skipping over the sentence it occurs in; some of these
  terms are explained briefly in the Glossary.


SECTION -- What Kind of Language is Python?
--------------------------------------------------------------------

  Python is a byte-code compiled programming language that supports
  multiple programming paradigms. Python is sometimes called an
  interpreted and/or scripting language because no separate
  compilation step is required to run a Python program; in more
  precise terms, Python uses a virtual machine (much like Java or
  Smalltalk) to run machine-abstracted instructions. In most
  situations a byte-code compiled version of an application is
  cached to speed future runs, but wherever necessary compilation
  is performed "behind the scenes."

  In the broadest terms, Python is an imperative programming
  language, rather than a declarative (functional or logical) one.
  Python is dynamically and strongly typed, with very late binding
  compared to most languages. In addition, Python is an
  object-oriented language with strong introspective facilities,
  and one that generally relies on conventions rather than
  enforcement mechanisms to control access and visibility of names.
  Despite its object-oriented core, much of the syntax of Python is
  designed to allow a convenient procedural style that masks the
  underlying OOP mechanisms. Although Python allows basic
  functional programming (FP) techniques, side effects are the
  norm, evaluation is always strict, and no compiler optimization
  is performed for tail recursion (nor on almost any other
  construct).

  Python has a small set of reserved words, delimits blocks and
  structure based on indentation only, has a fairly rich collection
  of built-in data structures, and is generally both terse and
  readable compared to other programming languages. Much of the
  strength of Python lies in its standard library and in a flexible
  system of importable modules and packages.


SECTION -- Namespaces and Bindings
--------------------------------------------------------------------

  The central concept in Python programming is that of a namespace.
  Each context (i.e., scope) in a Python program has available to
  it a hierarchically organized collection of namespaces; each
  namespace contains a set of names, and each name is bound to an
  object. In older versions of Python, namespaces were arranged
  according to the "three-scope rule" (builtin/global/local), but
  Python version 2.1 and later add lexically nested scoping. In
  most cases you do not need to worry about this subtlety, and
  scoping works the way you would expect (the special cases that
  prompted the addition of lexical scoping are mostly ones with
  nested functions and/or classes).

  There are quite a few ways of binding a name to an object
  within the current namespace/scope and/or within some other
  scope.  These various ways are listed below.

  TOPIC -- Assignment and Dereferencing
  --------------------------------------------------------------------

  A Python statement like 'x=37' or 'y="foo"' does a few things. If
  an object--e.g., '37' or '"foo"'--does not exist, Python creates
  one. If such an object -does- exist, Python locates it. Next, the
  name 'x' or 'y' is added to the current namespace, if it does not
  exist already, and that name is bound to the corresponding
  object. If a name already exists in the current namespace, it is
  re-bound. Multiple names, perhaps in multiple scopes/namespaces,
  can be bound to the same object.

  A simple assignment statement binds a name into the current
  namespace, unless that name has been declared as global.  A
  name declared as global is bound to the global (module-level)
  namespace instead.  A qualified name used on the left of an
  assignment statement binds a name into a specified
  namespace--either to the attributes of an object, or to the
  namespace of a module/package, for example:

      >>> x = "foo"              # bind 'x' in global namespace
      >>> def myfunc():          # bind 'myfunc' in global namespace
      ...     global x, y        # specify namespace for 'x', 'y'
      ...     x = 1              # rebind global 'x' to 1 object
      ...     y = 2              # create global name 'y' and 2 object
      ...     z = 3              # create local name 'z' and 3 object
      ...
      >>> import package.module  # bind name 'package.module'
      >>> package.module.w = 4   # bind 'w' in namespace package.module
      >>> from mymod import obj  # bind object 'obj' to global namespace
      >>> obj.attr = 5           # bind name 'attr' to object 'obj'

  Whenever a (possibly qualified) name occurs on the right side of
  an assignment, or on a line by itself, the name is dereferenced to
  the object itself. If a name has not been bound inside some
  accessible scope, it cannot be dereferenced; attempting to do so
  raises a 'NameError' exception. If the name is followed by left
  and right parentheses (possibly with comma-separated expressions
  between them), the object is invoked/called after it is
  dereferenced. Exactly what happens upon invocation can be
  controlled and overridden for Python objects; but in general,
  invoking a function or method runs some code, and invoking a
  class creates an instance. For example:

      >>> pkg.subpkg.func()   # invoke a function from a namespace
      >>> x = y               # deref 'y' and bind same object to 'x'

  TOPIC -- Function and Class Definitions
  --------------------------------------------------------------------

  Declaring a function or a class is simply the preferred way of
  describing an object and binding it to a name. But the 'def' and
  'class' declarations are "deep down" just types of assignments.
  In the case of functions, the `lambda` operator can also be used
  on the right of an assignment to bind an "anonymous" function to
  a name. There is no equally direct technique for classes, but
  their declaration is still similar in effect:

      >>> add1 = lambda x,y: x+y # bind 'add1' to function in global ns
      >>> def add2(x, y):        # bind 'add2' to function in global ns
      ...     return x+y
      ...
      >>> class Klass:           # bind 'Klass' to class object
      ...    def meth1(self):    # bind 'meth1' to method in 'Klass' ns
      ...        return 'Myself'

  TOPIC -- 'import' Statements
  --------------------------------------------------------------------

  Importing, or importing -from-, a module or a package adds or
  modifies bindings in the current namespace. The 'import'
  statement has two forms, each with a bit different effect.

  Statements of the forms:

      >>> import modname
      >>> import pkg.subpkg.modname
      >>> import pkg.modname as othername

  add a new module object to the current namespace.  These
  module objects themselves define namespaces that you can
  bind values in or utilize objects within.

  Statements of the forms:

      >>> from modname import foo
      >>> from pkg.subpkg.modname import foo as bar

  ...instead add the names 'foo' or 'bar' to the current namespace.
  In any of these forms of 'import', any statements in the imported
  module are executed--the difference between the forms is simply
  the effect upon namespaces.

  There is one more special form of the 'import' statement; for
  example:

      >>> from modname import *

  The asterisk in this form is not a generalized glob or regular
  expression pattern, it is a special syntactic form. "Import star"
  imports every name in a module namespace into the current
  namespace (except those named with a leading underscore, which
  can still be explicitly imported if needed). Use of this form is
  somewhat discouraged because it risks adding names to the current
  namespace that you do not explicitly request and that may rebind
  existing names.

  TOPIC -- 'for' Statements
  --------------------------------------------------------------------

  Although 'for' is a looping construct, the way it works is by
  binding successive elements of an iterable object to a name (in
  the current namespace). The following constructs are (almost)
  equivalent:

      >>> for x in somelist:  # repeated binding with 'for'
      ...     print x
      ...
      >>> ndx = 0             # rebinds 'ndx' if it was defined
      >>> while 1:            # repeated binding in 'while'
      ...    x = somelist[ndx]
      ...    print x
      ...    ndx = ndx+1
      ...    if ndx >= len(somelist):
      ...        del ndx
      ...        break

  TOPIC -- 'except' Statements
  --------------------------------------------------------------------

  The 'except' statement can optionally bind a name to an exception
  argument:

      >>> try:
      ...     raise "ThisError", "some message"
      ... except "ThisError", x:    # Bind 'x' to exception argument
      ...     print x
      ...
      some message


SECTION -- Datatypes
--------------------------------------------------------------------

  Python has a rich collection of basic datatypes. All of Python's
  collection types allow you to hold heterogeneous elements inside
  them, including other collection types (with minor limitations).
  It is straightforward, therefore, to build complex data
  structures in Python.

  Unlike many languages, Python datatypes come in two varieties:
  mutable and immutable. All of the atomic datatypes are immutable,
  as is the collection type 'tuple'. The collections 'list' and
  'dict' are mutable, as are class instances. The mutability of a
  datatype is simply a question of whether objects of that type can
  be changed "in place"--an immutable object can only be created
  and destroyed, but never altered during its existence. One upshot
  of this distinction is that immutable objects may act as
  dictionary keys, but mutable objects may not. Another upshot is
  that when you want a data structure--especially a large one--that
  will be modified frequently during program operation, you should
  choose a mutable datatype (usually a list).

  Most of the time, if you want to convert values between different
  Python datatypes, an explicit conversion/encoding call is
  required, but numeric types contain promotion rules to allow
  numeric expressions over a mixture of types. The built-in
  datatypes are listed below with discussions of each. The built-in
  function `type()` can be used to check the datatype of an object.

  TOPIC -- Simple Types
  --------------------------------------------------------------------

  bool
      Python 2.3+ supports a Boolean datatype with the possible
      values 'True' and 'False'.  In earlier versions of Python,
      these values are typically called '1' and '0'; even in
      Python 2.3+, the Boolean values behave like numbers in
      numeric contexts.  Some earlier micro-releases of Python
      (e.g.,  2.2.1) include the -names- 'True' and 'False', but
      not the Boolean datatype.

  int
      A signed integer in the range indicated by the register
      size of the interpreter's CPU/OS platform.  For most current
      platforms, integers range from (2**31)-1 to negative
      (2**31)-1. You can find the size on your platform by
      examining `sys.maxint`. Integers are the bottom numeric
      type in terms of promotions; nothing gets promoted -to- an
      integer, but integers are sometimes promoted to other
      numeric types.  A float, long, or string may be explicitly
      converted to an int using the `int()` function.

      SEE ALSO, [int]

  long
      An (almost) unlimited size integral number.  A long literal
      is indicated by an integer followed by an 'l' or 'L' (e.g.,
      '34L', '9876543210l').  In Python 2.2+, operations on ints
      that overflow `sys.maxint` are automatically promoted to
      longs.  An int, float, or string may be explicitly
      converted to a long using the `long()` function.

  float
      An IEEE754 floating point number.  A literal floating point
      number is distinguished from an int or long by containing a
      decimal point and/or exponent notation (e.g., '1.0', '1e3',
      '.453e-12', '37.').  A numeric expression that involves both
      int/long types and float types promotes all component types
      to floats before performing the computation.  An int, long,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区喷汁尤物| 一本大道久久a久久综合| 亚洲gay无套男同| 亚洲精品午夜久久久| 亚洲欧美另类在线| 亚洲女同ⅹxx女同tv| 亚洲精品日产精品乱码不卡| 亚洲综合一二区| 亚洲国产视频一区二区| 视频一区二区三区入口| 日本中文字幕一区二区有限公司| 日本一道高清亚洲日美韩| 麻豆成人久久精品二区三区小说| 亚洲国产日韩a在线播放性色| 亚洲欧美日韩一区二区三区在线观看| 亚洲欧美区自拍先锋| 亚洲成人动漫在线观看| 老司机一区二区| 国产宾馆实践打屁股91| 91免费视频大全| 欧美一二三区在线| 国产欧美视频一区二区三区| 有码一区二区三区| 午夜不卡av在线| 国内外成人在线视频| 97精品电影院| 日韩午夜激情视频| 自拍视频在线观看一区二区| 天涯成人国产亚洲精品一区av| 美女视频网站黄色亚洲| 99久久精品国产导航| 久久影院午夜片一区| 国产精品美女视频| 日本aⅴ精品一区二区三区| 国产丶欧美丶日本不卡视频| 日本高清不卡在线观看| 91精品在线免费观看| 国产精品网站在线| 五月天国产精品| 成人网男人的天堂| 日韩免费在线观看| 综合久久综合久久| 国产中文字幕精品| 欧美丰满一区二区免费视频| 中文字幕欧美激情| 日本不卡一区二区三区| 色爱区综合激月婷婷| 久久久无码精品亚洲日韩按摩| 天天影视涩香欲综合网| 91蜜桃网址入口| 国产清纯美女被跳蛋高潮一区二区久久w| 亚洲欧美色图小说| 国产成人高清视频| 26uuu国产电影一区二区| 亚洲国产另类av| 97久久精品人人做人人爽50路 | 国产成人欧美日韩在线电影| 欧美午夜电影一区| 亚洲日本电影在线| 成人av网址在线观看| 国产片一区二区| 久久99久国产精品黄毛片色诱| 奇米综合一区二区三区精品视频| 91网站黄www| 中文字幕欧美区| 高清国产午夜精品久久久久久| 精品成人免费观看| 老司机精品视频线观看86 | 视频一区中文字幕国产| 91社区在线播放| 国产精品青草综合久久久久99| 国产精品一二三| 久久久99久久| 国产精品一品二品| 中文欧美字幕免费| 成人性生交大合| 国产精品麻豆久久久| 色综合久久六月婷婷中文字幕| 亚洲欧美国产三级| 色94色欧美sute亚洲线路一久| 亚洲乱码国产乱码精品精小说| 91国偷自产一区二区使用方法| 亚洲精品欧美综合四区| 欧美老人xxxx18| 久久精工是国产品牌吗| 精品国产一区二区国模嫣然| 国产乱人伦精品一区二区在线观看| 久久中文字幕电影| 北条麻妃国产九九精品视频| 亚洲欧美福利一区二区| 欧美视频中文一区二区三区在线观看 | 亚洲午夜久久久久久久久电影网| 欧美在线视频你懂得| 视频在线在亚洲| 久久一区二区三区四区| 丰满少妇久久久久久久| 夜夜夜精品看看| 欧美一区二区三区在线观看| 国产精品一区二区三区网站| 国产精品天美传媒| 欧美视频三区在线播放| 韩国成人在线视频| 国产精品乱人伦一区二区| 欧美亚洲综合另类| 久久99精品国产.久久久久久| 国产日韩视频一区二区三区| 91女神在线视频| 秋霞午夜鲁丝一区二区老狼| 欧美国产国产综合| 制服丝袜亚洲精品中文字幕| 国产精品一色哟哟哟| 亚洲一区二区三区四区在线观看| 精品日韩欧美在线| 91精彩视频在线| 精品一区二区三区免费| 一区二区三区中文字幕电影 | 国产成人精品免费在线| 一区二区三区日韩在线观看| 日韩欧美国产一二三区| 91久久国产综合久久| 国产在线日韩欧美| 亚洲高清视频在线| 国产精品无码永久免费888| 日韩欧美中文字幕公布| 91精品福利视频| 成人av电影在线| 另类小说图片综合网| 午夜伦理一区二区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 中文字幕一区av| 日韩欧美成人午夜| 欧美手机在线视频| 在线一区二区三区做爰视频网站| 国产麻豆精品一区二区| 日韩综合小视频| 亚洲一区免费在线观看| 亚洲少妇最新在线视频| 国产精品初高中害羞小美女文| 久久久无码精品亚洲日韩按摩| 91精品国产品国语在线不卡| 欧美综合欧美视频| 99国产精品久久久久久久久久| 国产成人综合自拍| 久久97超碰国产精品超碰| 日韩福利电影在线观看| 亚洲伊人伊色伊影伊综合网| 亚洲色图另类专区| 一区二区三区在线免费播放| 国产精品乱人伦中文| 中文字幕在线不卡一区二区三区| 国产女同性恋一区二区| 久久中文字幕电影| 欧美国产精品久久| 国产精品成人网| 亚洲三级免费观看| 亚洲精品成a人| 亚洲va国产天堂va久久en| 日韩在线卡一卡二| 免费黄网站欧美| 国产一区二区三区日韩| 国产91清纯白嫩初高中在线观看| 风间由美中文字幕在线看视频国产欧美 | 欧美三级在线视频| 欧美日韩国产精品自在自线| 91精品国产美女浴室洗澡无遮挡| 欧美一区二区精品| 久久综合中文字幕| 国产精品国产自产拍高清av王其| 亚洲欧美日韩国产一区二区三区| 亚洲一区在线观看视频| 日韩精彩视频在线观看| 国产在线一区二区| 91在线视频免费观看| 欧美男人的天堂一二区| 欧美成人一级视频| 中文字幕日韩一区二区| 亚洲一区av在线| 国产综合色产在线精品| 99久久国产综合色|国产精品| 欧美日韩免费在线视频| 精品国产乱码久久久久久浪潮 | 久久电影国产免费久久电影| 国产精品一区二区在线观看不卡| eeuss鲁片一区二区三区在线看| 欧洲色大大久久| 久久日一线二线三线suv| 亚洲欧美中日韩| 男男视频亚洲欧美| 高清av一区二区| 欧美人狂配大交3d怪物一区| 国产午夜三级一区二区三| 亚洲激情男女视频| 韩国精品久久久| 欧美色图在线观看| 中文在线资源观看网站视频免费不卡| 亚洲丝袜精品丝袜在线| 国产一区高清在线| 欧美日韩黄视频| 国产精品久久久久久久久动漫| 免费看日韩精品|