The Python TutorialPython教程

Python is an easy to learn, powerful programming language. Python是一种易于学习、功能强大的编程语言。It has efficient high-level data structures and a simple but effective approach to object-oriented programming. 它具有高效的高级数据结构和简单但有效的面向对象编程方法。Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms.Python优雅的语法和动态类型,加上它的解释性质,使它成为大多数平台上许多领域的脚本编写和快速应用程序开发的理想语言。

The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python web site, https://www.python.org/, and may be freely distributed. Python解释器和广泛的标准库以源代码或二进制形式免费提供给Python网站上的所有主要平台,https://www.python.org/,并可自由分发。The same site also contains distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation.同一个站点还包含许多免费的第三方Python模块、程序和工具的分发版和指针,以及其他文档。

The Python interpreter is easily extended with new functions and data types implemented in C or C++ (or other languages callable from C). Python解释器可以很容易地用C或C++(或其他可从C调用的语言)实现的新函数和数据类型进行扩展。Python is also suitable as an extension language for customizable applications.Python也适合作为可定制应用程序的扩展语言。

This tutorial introduces the reader informally to the basic concepts and features of the Python language and system. 本教程非正式地向读者介绍Python语言和系统的基本概念和功能。It helps to have a Python interpreter handy for hands-on experience, but all examples are self-contained, so the tutorial can be read off-line as well.有一个方便的Python解释器有助于亲身体验,但所有示例都是独立的,因此教程也可以离线阅读。

For a description of standard objects and modules, see The Python Standard Library. 有关标准对象和模块的描述,请参阅Python标准库The Python Language Reference gives a more formal definition of the language. Python语言参考给出了该语言更正式的定义。To write extensions in C or C++, read Extending and Embedding the Python Interpreter and Python/C API Reference Manual. 要用C或C++编写扩展,请阅读扩展和嵌入Python解释器Python/C API参考手册There are also several books covering Python in depth.还有几本书深入介绍了Python。

This tutorial does not attempt to be comprehensive and cover every single feature, or even every commonly used feature. 本教程并不试图全面介绍每一个功能,甚至每一个常用功能。Instead, it introduces many of Python’s most noteworthy features, and will give you a good idea of the language’s flavor and style. 相反,它引入了许多Python最值得注意的特性,并将让您对该语言的风格和风格有一个很好的了解。After reading it, you will be able to read and write Python modules and programs, and you will be ready to learn more about the various Python library modules described in The Python Standard Library.阅读后,您将能够阅读和编写Python模块和程序,并且您将准备好了解Python标准库中描述的各种Python库模块的更多信息。

The Glossary is also worth going through.词汇表也值得一读。