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
你可能必须使用几个C/C++/Java库
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.
但你不想为你的应用程序来设计与实现一个完整的新语言

Python is just the language for you.
Python正式你所需要的语言
You could write a Unix shell script or Windows batch files for some of these tasks,
你可以为其中一些任务写一个Unix shell脚本或Windows批处理文件
but shell scripts are best at moving around files and changing text data,
但是shell脚本最适合处理文件移动和文本编辑
not well-suited for GUI applications or games.
而不适用于GUI应用程序和游戏
You could write a C/C++/Java program,
你可以用C/C++/Java写一个程序
but it can take a lot of development time to get even a first-draft program.
但是可能会花费大量的开发时间去完成一份初稿
Python is simpler to use,
Python更易于使用
available on Windows, Mac OS X, and Unix operating systems,
在Windows,MacOSX和Unix操作系统上可用
and will help you get the job done more quickly.
并且将帮助你更快地完成工作

Python is simple to use,
Python使用起来很简单
but it is a real programming language,
但它是一种真正的编程语言
offering much more structure and support for large programs than shell scripts or batch files can offer.
与Shell脚本或批处理文件相比,它可以为大型程序提供更多的结构和支持
On the other hand,
另一方面
Python also offers much more error checking than C,
Python还提供比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,
Python的适用领域比Awk甚至Perl要广泛的多
yet many things are at least as easy in Python as in those languages.
而且很多事情在Python中至少和那些语言一样容易

Python allows you to split your program into modules that can be reused in other Python programs.
Python语言你将你的程序拆分成可以在其他Python程序中再次使用的模块
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.
它有一大批的标准模块,你可以用它作为你的程序的基础-或者作为例子开始学习使用Python编程
Some of these modules provide things like file I/O, system calls, sockets,
这些模块提供诸如文件I/O,系统调用,套接字
and even interfaces to graphical user interface toolkits like Tk.
甚至还为像TK这样的图形界面开发包提供接口

Python is an interpreted language,
Python是一门解释性的语言
which can save you considerable time during program development because no compilation and linking is necessary.
因为没有编译和链接,它可以节省你程序开发过程中的大量时间
The interpreter can be used interactively,
Python解释器可以交互地使用
which makes it easy to experiment with features of the language,
这使得试验Python语言的特性,
to write throw-away programs, or to test functions during bottom-up program development.
编写用后即仍的程序或在自底向上的程序开发中测试功能非常容易
It is also a handy desk calculator.
它也是一个方便的桌面计算器

Python enables programs to be written compactly and readably.
Python使程序编写起来能够简洁易读
Programs written in Python are typically much shorter than equivalent C, C++, or Java programs,
编写的Python程序通常比等价的C,C++或Java程序短很多
for several reasons:
原因有几个:

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.
不需要为变量或参数进行声明

Python is extensible:
Python是可扩展的
if you know how to program in C
如果你会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).
或者链接Python程序到只能以二进制形式可用的库(例如供应商特定的图形库)
Once you are really hooked,
一旦你真的着迷
you 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编写的应用程序中,并把它当做那个程序的扩展或命令行语言

By the way,
顺便说一句
the language is named after the BBC show “Monty Python’s Flying Circus” and has nothing to do with reptiles.
Python语言的名字来自于BBC的“Monty Python’s Flying Circus”节目,与爬行动物无关
Making references to Monty Python skits in documentation is not only allowed, it is encouraged!
我们不仅允许,甚至鼓励你在代码中引用Monty Python短剧

Now that you are all excited about Python,
既然现在你们都为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解释器练习

In the next chapter,
在下一章中
the mechanics of using the interpreter are explained.
我们将解释Python解释器的用法
This is rather mundane information,
这是很简单的一件事情
but essential for trying out the examples shown later.
但它有助于试验后面的例子

The rest of the tutorial introduces various features of the Python language and system through examples,
本教程的其余部分通过实例介绍了Python语言和体系的各种特性
beginning with simple expressions, statements and data types,
以简单的表达,语句和数据类型开始,
through functions and modules,
然后是函数和模块
and finally touching upon advanced concepts like exceptions and user-defined classes.
最后讲述高级概念,如异常和用户自定义的类.

001_Whetting Your Appetite_引言相关推荐

  1. 《数据科学R语言实践:面向计算推理与问题求解的案例研究法》一一2.1 引言...

    本节书摘来自华章计算机<数据科学R语言实践:面向计算推理与问题求解的案例研究法>一书中的第2章,第2.1节,作者:[美] 德博拉·诺兰(Deborah Nolan) 邓肯·坦普·朗(Dun ...

  2. 2018-3-20论文(一种新的群体智能算法--狼群算法)笔记一(引言中提到的的一些智能算法,以及自己的感想)

    思想: 模拟狼群捕食行为以及猎物分配方式,抽象出游走,召唤,围攻三种智能行为以及"胜者为王"的头狼产生规则和"强者生存"的狼群更新机制. 引言中提到的智能优化算 ...

  3. Spring基础专题——引言

    前言:去年到现在一直没有很好的时间完成这个spring基础+源码的博客目标,去年一年比较懒吧,所以今年我希望我的知识可以分享给正在奋斗中的互联网开发人员,以及未来想往架构师上走的道友们我们一起进步,从 ...

  4. 华裔教授教你写论文2.引言的逻辑解析

    导语: "引言的作用就好比搭一座桥,我们要引导读者从他们现有的地方,走过桥来,进入我们的世界.所以在桥的另一端,也就是引言的开头,我们最好能够和读者现有的知识框架,建立某种联系." ...

  5. 《嵌入式Linux与物联网软件开发——C语言内核深度解析》一第1章 C语言与内存1.1 引言...

    本节书摘来自异步社区<嵌入式Linux与物联网软件开发--C语言内核深度解析>一书中的第1章,第1.1节,作者朱有鹏 , 张先凤,更多章节内容可以访问云栖社区"华章计算机&quo ...

  6. 《Unity着色器和屏幕特效开发秘笈》—— 2.1 引言

    本节书摘来自华章出版社<Unity着色器和屏幕特效开发秘笈>一 书中的第2章,第2.1节,作者:(美)Kenny Lammers,更多章节内容可以访问云栖社区"华章计算机&quo ...

  7. 《移动数据挖掘》—— 第1章 引言 1.1 移动数据及其价值

    本节书摘来自华章出版社<移动数据挖掘>一 书中的第1章,第1.1节,作者潘晓.霍 峥.孟小峰,更多章节内容可以访问云栖社区"华章计算机"公众号查看. 第1章 引言 第1 ...

  8. 《JavaScript面向对象编程指南》——第1章 引言1.1 回顾历史

    本节书摘来自异步社区<JavaScript面向对象编程指南>一书中的第1章,第1.1节,作者: [加]Stoyan Stefanov 译者: 凌杰 更多章节内容可以访问云栖社区" ...

  9. 中国人工智能学会通讯——搜狗搜索:从搜索到问答 1.1 引言

    1.1 引言 互联网搜索引擎为人们获取信息提供了极大帮助,目前仍是网民获取信息和知识的重要工具.通常使用搜索引擎的典型过程包括三个步骤,首先用户将自己的需求以自然语言查询的方式表达,并提交给搜索引擎: ...

最新文章

  1. 【Zookeeper】Zookeeper集群“脑裂”问题处理大全
  2. linux显卡驱动mxm,linux下我的FX5200显卡驱动安装
  3. c#数据库訪问返回值类型为SqlDataReader时使用using时注意的问题
  4. 【动态规划】加法最大 (ssl 1595)/乘积最大 (ssl 1007)
  5. 在控制台输出九九乘法表
  6. 狮子鱼社区团购独立版V15.3.0源码
  7. MapReduce+MapReduce执行过程(四)
  8. python同步远程文件夹_利用python实现两个文件夹的同步
  9. matlab各种出错,matlab常见错误命令汇总
  10. 手记 《半年工作经验今日头条和美团面试题面经分享》
  11. L1-025__032
  12. html实现飞机小游戏(源码)
  13. 王道考研数据结构之------循环单链表
  14. 包络线公式如何用计算机求,包络线公式(图表控件)
  15. 什么是产品经理?主要职责是什么?
  16. XML格式文件详解及Java解析XML文件内容方法
  17. 商务培训计划汇报通用PPT模板
  18. 计算机安排表,计算机系考安排表.doc
  19. CodingGame - Shadows of the Knight - Episode 1思路
  20. CodeForces 888G Xor-MST (异或最小生成树+01trie)

热门文章

  1. 分布、描述性统计和贡献度分析
  2. 银川二中2021高考模拟考试成绩查询,银川市第二中学2020—2021年第一学期高一月考成绩分享会...
  3. 编译Android源码(9.0)
  4. html的常用标签,系列篇
  5. Gson 中对象类型的相互转换
  6. Fast Ground Segmentation for 3D LiDAR Point Cloud Based on Jump-Convolution-Process实现
  7. ZeroSSL:又一款免费申请SSL证书的利器
  8. C语言程序课程设计—读心术
  9. 基于android的在线音乐播放器app设计
  10. Mysql Mac 免安装教程