This is the full Python grammar, as it is read by the parser generator and used to parse Python source files: Grammar for Python Note: Changing the grammar specif
The Python interpreter can get its input from a number of sources: from a script passed to it as standard input or as program argument, typed in interactively, from a
Compound statements contain (groups of) other statements;they affect or control the execution of those other statements in some way In general, compound statements span mult
A simple statement is comprised within a single logical line Several simple statements may occur on a single line separated by semicolons The syntax for simple statements
This chapter explains the meaning of the elements of expressions in Python Syntax Notes:In this and the following chapters, extended BNF notation will be used to describe
Python code in onemodulegains access to the code in another module by the process ofimportingit Theimportstatement is the most common way of invoking the import machinery,
4 1 命名与绑定变量名指定对象 变量通过名称绑定完成 每一个变量通过绑定之后供程序调用 一个块是一段单独python代码 块包括: 一个模块,一段方法体,一个类 每个可交互的命令的是一个块 一个脚本文件 (可以被
3 1 对象,值和类型对象是Python对数据的抽象 All data in a Python program is represented by objects or by relations between objects (In a sense, and in conformance to Von Neu
Python程序是通过解析器读取的Input to the parser is a stream oftokens, generated by thelexical analyzer This chapter describes how the lexical analyzer breaks a file into toke
这份参考手册讲述Python编程语言。它并不打算作为一个教程。除了语法和词法分析,在尽可能精确的同时,对所有内容我选择使用英语而不是形式化的说明。这应该使得这份文档对一般读者更容易理解, 但将导致某些地方