Python is a high-level, interpreted scripting language developed in the late 1980s by Guido van Rossum at the National Research Institute for Mathematics and Computer Science in the Netherlands. The initial version was published at the alt.sources newsgroup in 1991, and version 1.0 was released in 1994.
Python是由荷兰国家数学和计算机科学研究院的Guido van Rossum于1980年代后期开发的一种高级，解释性脚本语言。 初始版本于1991年在alt.sources 新闻组中发布，而1.0版于1994年发布。
Python 2.0 was released in 2000, and the 2.x versions were the prevalent releases until December 2008. At that time, the development team made the decision to release version 3.0, which contained a few relatively small but significant changes that were not backward compatible with the 2.x versions. Python 2 and 3 are very similar, and some features of Python 3 have been backported to Python 2. But in general, they remain not quite compatible.
Python 2.0于2000年发布，而2.x版本是直到2008年12月为止的普遍版本。当时，开发团队决定发布版本3.0，该版本包含一些相对较小但重要的更改，这些更改不向后兼容2.x版本。 Python 2和3非常相似，并且Python 3的某些功能已向后移植到Python2。但是，总的来说，它们仍然不太兼容。
Both Python 2 and 3 have continued to be maintained and developed, with periodic release updates for both. As of this writing, the most recent versions available are 2.7.13 and 3.6.0. However, an official End Of Life date of January 1, 2020 has been established for Python 2, after which time it will no longer be maintained. If you are a newcomer to Python, it is recommended that you focus on Python 3, as this tutorial will do.
Python 2和3都将继续得到维护和开发，并且会定期对其进行更新。 在撰写本文时，可用的最新版本是2.7.13和3.6.0。 但是，Python 2的正式停产日期为2020年1月1日 ，此后将不再维护。 如果您是Python的新手，建议您专注于Python 3，就像本教程一样。
Python is still maintained by a core development team at the Institute, and Guido is still in charge, having been given the title of BDFL (Benevolent Dictator For Life) by the Python community. The name Python, by the way, derives not from the snake, but from the British comedy troupe Monty Python’s Flying Circus, of which Guido was, and presumably still is, a fan. It is common to find references to Monty Python sketches and movies scattered throughout the Python documentation.
Python仍由该研究所的核心开发团队维护，而Guido仍然由Python社区授予BDFL（终身仁慈的独裁者）头衔。 顺便说一句，Python的名称不是源自蛇，而是源自英国喜剧团Monty Python的《飞天马戏团 》，Guido一直是并且可能仍然是粉丝。 通常会找到散布在整个Python文档中的Monty Python草图和电影的引用。
为什么选择Python？ (Why Choose Python?)
If you’re going to write programs, there are literally dozens of commonly used languages to choose from. Why choose Python? Here are some of the features that make Python an appealing choice.
如果您要编写程序，则实际上有数十种常用语言可供选择。 为什么选择Python？ 以下是一些使Python成为有吸引力的选择的功能。
Python很流行 (Python is Popular)
Python has been growing in popularity over the last few years. The 2018 Stack Overflow Developer Survey ranked Python as the 7th most popular and the number one most wanted technology of the year. World-class software development countries around the globe use Python every single day.
Due to the popularity and widespread use of Python as a programming language, Python developers are sought after and paid well. If you’d like to dig deeper into Python salary statistics and job opportunities, you can do so here.
由于Python作为编程语言的流行和广泛使用，Python开发人员受到追捧并获得了丰厚的报酬。 如果您想更深入地了解Python的薪资统计和工作机会，可以在这里进行 。
解释了Python (Python is Interpreted)
Many languages are compiled, meaning the source code you create needs to be translated into machine code, the language of your computer’s processor, before it can be run. Programs written in an interpreted language are passed straight to an interpreter that runs them directly.
This makes for a quicker development cycle because you just type in your code and run it, without the intermediate compilation step.
One potential downside to interpreted languages is execution speed. Programs that are compiled into the native language of the computer processor tend to run more quickly than interpreted programs. For some applications that are particularly computationally intensive, like graphics processing or intense number crunching, this can be limiting.
解释语言的潜在缺点之一是执行速度。 编译成计算机处理器本地语言的程序往往比解释程序运行得更快。 对于某些计算量特别大的应用程序，例如图形处理或大量数字运算，这可能会受到限制。
In practice, however, for most programs, the difference in execution speed is measured in milliseconds, or seconds at most, and not appreciably noticeable to a human user. The expediency of coding in an interpreted language is typically worth it for most applications.
Further reading: See this Wikipedia page to read more about the differences between interpreted and compiled languages.
Python是免费的 (Python is Free)
The Python interpreter is developed under an OSI-approved open-source license, making it free to install, use, and distribute, even for commercial purposes.
A version of the interpreter is available for virtually any platform there is, including all flavors of Unix, Windows, macOS, smartphones and tablets, and probably anything else you ever heard of. A version even exists for the half dozen people remaining who use OS/2.
几乎所有平台都可以使用该解释器的版本，包括Unix，Windows，macOS，智能手机和平板电脑的所有版本，以及您可能听说过的任何其他版本。 甚至还为剩下一半的使用OS / 2的人提供了一个版本。
Python是可移植的 (Python is Portable)
Because Python code is interpreted and not compiled into native machine instructions, code written for one platform will work on any other platform that has the Python interpreter installed. (This is true of any interpreted language, not just Python.)
Python很简单 (Python is Simple)
As programming languages go, Python is relatively uncluttered, and the developers have deliberately kept it that way.
A rough estimate of the complexity of a language can be gleaned from the number of keywords or reserved words in the language. These are words that are reserved for special meaning by the compiler or interpreter because they designate specific built-in functionality of the language.
Python 3 has 33 keywords, and Python 2 has 31. By contrast, C++ has 62, Java has 53, and Visual Basic has more than 120, though these latter examples probably vary somewhat by implementation or dialect.
Python 3有33个关键字，Python 2有31个关键字。相比之下，C ++有62个关键字，Java有53个，Visual Basic有120个以上，尽管后面的示例可能因实现或方言而有所不同。
Python code has a simple and clean structure that is easy to learn and easy to read. In fact, as you will see, the language definition enforces code structure that is easy to read.
但这不是那么简单 (But It’s Not That Simple)
For all its syntactical simplicity, Python supports most constructs that would be expected in a very high-level language, including complex dynamic data types, structured and functional programming, and object-oriented programming.
Additionally, a very extensive library of classes and functions is available that provides capability well beyond what is built into the language, such as database manipulation or GUI programming.
Python accomplishes what many programming languages don’t: the language itself is simply designed, but it is very versatile in terms of what you can accomplish with it.
This section gave an overview of the Python programming language, including:
- A brief history of the development of Python
- Some reasons why you might select Python as your language of choice
Python is a great option, whether you are a beginning programmer looking to learn the basics, an experienced programmer designing a large application, or anywhere in between. The basics of Python are easily grasped, and yet its capabilities are vast.
Proceed to the next section to learn how to acquire and install Python on your computer.
Get Notified: Don’t miss the follow up to this tutorial—Click here to join the Real Python Newsletter and you’ll know when the next instalment comes out.
通知您：不要错过本教程的后续内容- 单击此处加入Real Python Newslet ，您将知道下一期的发行时间。