Python入门指南 (中英文版高清PDF下载)

c#小王子 c#小王子 2021-05-07 1396 软件,编程,Python


Python入门指南 (中英文版高清PDF下载)


Abstract


Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python'selegant 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 是一种容易学习的强大的编程语言。它包含了高效的高级数据结构,能够用简单而高效的方式进行面向对象编程。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, and may be freely distributed. The same site also contains distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation.

Python 解释器及其扩展标准库的源码和编译版本可以从Python 的Web 站点,及其所有镜像站上免费获得,并且可以自由发布。该站点上也提供了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 is also suitable as an extension language for customizable applications.

Python解释器可以很容易的通过C或者C++(或者 其它可以通过C调用的语 言)扩展新 函数和数据类型。Python 也可以作为定制应用的扩展语言。


This tutorial introduces the reader informally to the basic concepts and features of the Python language and system. 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 语言及其系统的基本知识与概念。配合Python解释器学习会很有帮助,不过所有的例子都已包括在文中,所以这本手册也很可以离线阅读。


For a description of standard objects and modules, see the Python Library Reference document. The Python Refer- ence Manual gives a more formal definition of the language. To write extensions in C or C++, read Extending and Embedding the Python Interpreter and Python/C API Reference. There are also several books covering Python in depth

需要有关标准对象和模块的详细介绍的话,请查询Python 库参考手册文档。Python 参考手册提供了更多的关于语言方面的正式说明。需要编写C或C++扩展,请阅读Python 解释器的扩展和集成以及Python/C API 参考手册。这几本书涵盖了各个深度上的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.After readingit, 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 Library Reference.本手册不会涵盖Python 的所有功能,也不会去解释所用到的所有相关的知识。相反,它介绍了许多Python中最引人注目的功能,这会对读者掌握这门语言的风格大有帮助。读过它后,你应该可以阅读和编写Python模块和程序,接下来可以从Python 库参考手册 中进一步学习Python复杂多变的库和模块。


CHAPTER

ONE


If you do much work on computers, eventually you find that there's some task you'd like to automate. For example, you may wish to perform a search-and-replace over a large number of text files, or rename and rearrange a bunch of photo files in a complicated way. Perhaps you'd like to write a small custom database, or a specialized GUI application, or a simple game.

假设如果你要用计算机做很多工作,你希望有些任务可以自动完成。例如,你可能希望在大量的文本文件中进行查找替换操作,也许是通过复杂的方式重命名并重新摆放一批图像文件。可能你喜欢写个小的定制数据库,或者特殊的GUI应用程序,或者简单的游戏。


If you're a professional software developer, you may have to work with several C/C++/Java libraries but find the usual write/compile/test/re-compile cycle is too slow. Perhaps you're writing a test suite for such a library and find writing the testing code a tedious task. Or maybe you've written a program that could use an extension language, and you don't want to design and implement a whole new language for your application.

如果你是个专业的软件开发者,你可能要用几个C/C++/Java 库工作,但是发现通常的编写/编译/测试/重编译循环太慢了。可能你在给每个库编写对应的测试代码,但是发现这是一个烦人的活儿。或者你在编写一个带有扩展语言的程序,而你 不想给你的应用程序设计和实现一门全新的语言。 Python is just the language for you. Python 就是你需要的语言。


You could write a UNIX shell script or Windows batch files for some of these tasks, but shell scripts are best at moving around files and changing text data, not well-suited for GUI applications or games. You could write a C/C++/Java program, but it can take a lot of development time to get even a first-draft program. Python is simpler to use, available on Windows, MacOS X, and UNIX operating systems, and will help you get the job done more quickly.

你能够针对一些任务编写UNIX shell 脚本或者Windows 批处理文件,但是脚本语言最擅长移动文 件和修改文本数据,不适合GUI应用程序或者游戏。你能写C/C++/Java程序,但是这些技术就是开发最简单的程序也要用去大量的开发时间。无论在Windows、MacOS X 或者UNIX 操作系统上,Python 非常易于使用,可以帮助你更快的完成任务。


Python is simple to use, but it is a real programming language,offering much more structure and support for large pro- grams than shell scripts or batch files can offer. On the other hand, Python also offers much more error checking than C, and, being a very-high-level language,it has high-level data types built in,such as flexible arrays and dictionaries. Because of its more general data types Python is applicable to a much larger problem domain than Awk or even Perl, yet many things are at least as easy in Python as in those languages.

Python 很容易上手,但它是一门真正的编程语言,相对于Shell,它提供的针对大型程序的支持和结构要多的多。另一方面,它提供了比C更多的错误检查,并且,做为一门非常高级的语言,它拥有内置的高级数据类型,例如可变数组和字典,如果通过C来实现的话,这些工作可能让你大干上几天的时间。因为拥有更多的通用数据类型,Python 适合比Awk 甚至Perl 更广泛的问题领域,在其它的很多领域,Python 至少比别的语言要易用得多。


Python allows you to split your program into modules that can be reused in other Python programs.It comes with a large collection of standard modules that you can use as the basis of your programs —or as examples to start learning to program in Python. Some of these modules provide things like file I/O, system calls, sockets,and even interfaces to graphical user interface toolkits like Tk.

Python 可以让你把自己的程序分隔成不同的模块,以便在其它的Python 程序中重用。这样你就可以让自己的程序基于一个很大的标准模块集或者用它们做为示例来学习Python 编程。Python 中集成了一些类似文件I/O,系统调用,sockets,甚至像Tk 这样的图形工具接口。


Python is an interpreted language, which can save you considerable time during program development because no compilation and linking is necessary. The interpreter can be used interactively, which makesit easy to experiment with features of the language, to write throw-away programs, or to test functions during bottom-up program development. It is also a handy desk calculator.

Python是一门解释型语言,因为不需要编译和链接的时间,它可以帮你省下一些开发时间。解释器可以交互式.使用。这样就可以很方便的测试语言中的各种功能,以便干编写发布用的程序, 或者进行自下而上的开发。还可以当它是一个随手可用的计算器。


Python enables programs to be written compactly and readably. Programs written in Python are typically much shorter than equivalent C, C++, or Java programs, for several reasons:

Python 可以写出很紧凑和可读性很强的程序。用Python 写的程序通常比同样的C、C++ 或Java程序要短得多,这是因为以下几个原因∶


· the high-level data types allow you to express complex operations in a single statement;· statement grouping is done by indentation instead of beginning and ending brackets;● no variable or argument declarations are necessary.

● 高级数据结构使你可以在一个单独的语句中表达出很复杂的操作;●语句 的组织依赖于缩进而不是begin/end 块;●不需要变量或参数声明。


Python is extensible: if you know how to program in C it is easy to add a new built-in function or module to the interpreter, either to perform critical operations at maximum speed, or to link Python programs to libraries that may only be available in binary form (such as a vendor-specific graphics library). Once vou are really hooked. vou can link the Python interpreter into an application written in C and use it as an extension or command language for that application.

Python 是可扩展的∶ 如果你会用C语言写程序,那就可以很容易的为解释器添加新的集成模块和功能,或者优,化瓶颈。使其达到最大速 度, 或者使Python 能够链接到所需的二进制架构上(比如某个专用的商业图形库)。等你真正熟悉这一切了,你就可以将Python 集成进由C 写成的程序,把Python 当做这个程序的扩展或命令行语言。


By the way, the language is named after the BBC show"Monty Python's Flying Circus"and has nothing to do with nasty reptiles. Making references to Monty Python skits in documentation is not only allowed, it is encouraged!顺便说一下,这个语言的名字来源于BBC 的"Monty Python's Flying Circus"节目,和凶猛的爬虫没有任何关系。在文档中引用Monty Python 典故不仅是允许的,而且还受到鼓励!


Now that you are all excited about Python,you'll want to examine it in some more detail. Since the best way to learn a language is to use it, the tutorial invites you to play with the Python interpreter as you read.

现在我们已经了解了Python 中所有激动人心的东西,大概你想仔细的试试它了。学习一门语言最好的办法就是使用 它,如你所读到的,本文会引领你运用Python 解释器。


In the next chapter, the mechanics of using the interpreter are explained.This is rather mundane information,but essential for trying out the examples shown later.

下一节中,我们直接说明解释器的用法。这没有什么神秘的内容,不过有助于我们练习后面展示的例子。



【下载地址】

链接:https://pan.baidu.com/s/106JPvx0d2ItDdYaFLipirg

提取码:a4g5


相关文章


R基础及应用-大数据分析(高清PDF 下载)

为了更好地适应新形势,满足读者对大数据分析处理学习的迫切需要,我们推出了《大数据分析 ∶ R基础及应用》一书 ,力求使读者能够从中了解大数据

《R数据科学》高清中/英文版PDF+源代码

读完本书后,你将掌握R语言的精华,并能够熟练使用多种工具来解决各种数据科学难题。

用Python写网络爬虫(高清PDF 下载)

网络爬虫是一个自动提取网页的程序,它为搜索引擎从万维网上下载网页,是搜索引擎的重要组成。传统爬虫从一个或若干初始网页的URL开始, 获得初始

用Python进行自然语言处理(高清PDF 下载)

通过它,你将学到如何写能处理大量非结构化文本的 Python 程序。你将获得有丰富标注的涵盖语言学各种数据结构的数据集,而且你将学到分析书面

简明python教程(高清PDF下载)

本书可以作为Python编程语言的一本指南或者教程。它主要是为新手而设计,不过对于有经验的程序员来说,它同样有用。

集体智慧编程-python算法应用(高清PDF 下载)

本书以机器学习与计算统计为主题背景,专门讲t述如何挖掘和分析 Web,上的数据和资源,如何分析用户体验、市场营销、个人品味等诸多信息,并得出

编程小白的第一本+python+入门书(高清PDF下载)

为了能让更多的编程小自轻松地入门编程,我把高效学习法结合 Pvthon 中的核心知识,写成了这本书。随意翻上几页,你就会发现这本书和其他编程

笨办法学.Python.(第三版)(高清PDF下载)

本书结构非常简单,其实就是 52 个习题。其中 26 个覆盖了输入输出、变量、以及函数三个课题,另外 26个覆盖了一些比较高级的话题,如条件

Python源码剖析(高清PDF 下载)

本书以CPython为研究对象,在C代码一级,深入细致地剖析了Python的实现。本书不仅包括了对大量Python内置对象的剖析,更将大量的

Python学习手册(第4版)(中文版高清PDF 下载)

本书是学习Python编程语言的入门书籍。Python是一种很流行的开源编程语言,可以在各种领域中用于编写独立的程序和脚本。Python免费

Python算法教程_中文版(高清PDF下载)

本书用 Python 语言来讲解算法的分析和设计。本书主要关注经典的算法,但同时会为读者理解基本算法问题和解决问题打下很好的基础。全书共 1

Python数据分析基础(高清PDF下载)

本书面向的读者是那些经常使用电子表格软件进行数据处理,但从未写过一行代码的人。前几章会教你设置 Python 运行环境,告诉你计算机是如何看

Python神经网络编程中英文(高清PDF下载)

神经网络是一种模拟人脑的神经网络,以期能够实现类人工智能的机器学习技术。本书揭示神经网络背后的概念,并介绍如何通过Pvthon实现神经网络。

Python入门指南 (中英文版高清PDF下载)

Python 是一种容易学习的强大的编程语言。它包含了高效的高级数据结构,能够用简单而高效的方式进行面向对象编程。Python 优雅的语法和

PYTHON入门经典_超高清pdf

本书是面向 Python 初学者的学习指南,详细介绍了 Python 编程基础,以及一些高级概念,如面向对象编程。


文章热度: 166291
文章数量: 333
推荐阅读

FlashFXP绿色版网盘下载,附激活教程 1045

FlashFxp百度网盘下载链接:https://pan.baidu.com/s/1MBQ5gkZY1TCFY8A7fnZCfQ。FlashFxp是功能强大的FTP工具

Adobe Fireworks CS6 Ansifa绿色精简版网盘下载 782

firework可以制作精美或是可以闪瞎眼的gif,这在广告领域是需要常用的,还有firework制作下logo,一些原创的图片还是很便捷的,而且fireworks用法简单,配合dw在做网站这一块往往会发挥出很强大的效果。百度网盘下载链接:https://pan.baidu.com/s/1fzIZszfy8VX6VzQBM_bdZQ

navicat for mysql中文绿色版网盘下载 831

Navicat for Mysql是用于Mysql数据库管理的一款图形化管理软件,非常的便捷和好用,可以方便的增删改查数据库、数据表、字段、支持mysql命令,视图等等。百度网盘下载链接:https://pan.baidu.com/s/1T_tlgxzdQLtDr9TzptoWQw 提取码:y2yq

火车头采集器(旗舰版)绿色版网盘下载 1154

火车头采集器是站长常用的工具,相比于八爪鱼,简洁好用,易于配置。火车头能够轻松的抓取网页内容,并通过自带的工具对内容进行处理。站长圈想要做网站,火车头采集器是必不可少的。百度网盘链接:https://pan.baidu.com/s/1u8wUqS901HgOmucMBBOvEA

Photoshop(CS-2015-2023)绿色中文版软件下载 1470

安装文件清单(共46G)包含Window和Mac OS各个版本的安装包,从cs到cc,从绿色版到破解版,从安装文件激活工具,应有尽有,一次性打包。 Photoshop CC绿色精简版 Photoshop CS6 Mac版 Photoshop CC 2015 32位 Photoshop CC 2015 64位 Photoshop CC 2015 MAC版 Photoshop CC 2017 64位 Adobe Photoshop CC 2018 Adobe_Photoshop_CC_2018 Photoshop CC 2018 Win32 Photoshop CC 2018 Win64

知之

知之平台是全球领先的知识付费平台。提供各个领域的项目实战经验分享,提供优质的行业解决方案信息,来帮助您的工作和学习

使用指南 建议意见 用户协议 友情链接 隐私政策 Powered by NOOU ©2020 知之