python引导及综述:
相对于Perl/Ruby/Scheme/Java来说,python是一门更为简单高效的面向对象编程语言。
如下是python的一些显著特征:
使用优雅的语法,使您编写的程序更易于阅读。
Is an easy-to-use language that makes it simple to get your program working. This makes Python ideal for prototype development and other ad-hoc programming tasks, without compromising maintainability.
是一种易于使用的语言,它使程序运行变得简单。这使得Python非常适合于原型开发和其他ad-hoc编程任务,而不影响可维护性。
Comes with a large standard library that supports many common programming tasks such as connecting to web servers, searching text with regular expressions, reading and modifying files.
附带一个大型标准库,支持许多常见的编程任务,如连接到Web服务器、使用正则表达式搜索文本、读取和修改文件。
Python's interactive mode makes it easy to test short snippets of code. There's also a bundled development environment called IDLE.
Python的交互模式使测试短代码片段变得容易。还有一个称为空闲的捆绑开发环境。
Is easily extended by adding new modules implemented in a compiled language such as C or C++.
通过添加新的模块在编译语言如C或C++实现轻松扩展。
Can also be embedded into an application to provide a programmable interface.
也可以嵌入到应用程序中以提供可编程接口。
也可以嵌入到应用程序中以提供可编程接口。
运行在任何地方,包括Mac OS X、Windows、Linux和UNIX,非官方版本还可用于Android和iOS。
从两个方面定义free:下载或使用Python或将其包含在应用程序中完全免费;Python也可以自由修改和重新分发,因为虽然语言是受版权保护的,但它可以在开放源码许可下使用。
Python的一些编程语言特性是:
A variety of basic data types are available: numbers (floating point, complex, and unlimited-length long integers), strings (both ASCII and Unicode), lists, and dictionaries.
可以使用各种基本数据类型:数字(浮点、复杂和无限长长整数)、字符串(ASCII和Unicode)、列表和字典。
Python supports object-oriented programming with classes and multiple inheritance.
Python支持类和多继承的面向对象编程。
Code can be grouped into modules and packages.
代码可以分为模块和包。
The language supports raising and catching exceptions, resulting in cleaner error handling.
语言支持提高和捕获异常,从而导致更干净的错误处理。
Data types are strongly and dynamically typed. Mixing incompatible types (e.g. attempting to add a string and a number) causes an exception to be raised, so errors are caught sooner.
数据类型是强动态类型的。混合不兼容类型(例如试图添加字符串和数字)会引发异常,因此错误会更快被捕获。
Python contains advanced programming features such as generators and list comprehensions.
Python包含高级编程的特点,如发电机和列表解析。
Python's automatic memory management frees you from having to manually allocate and free memory in your code.
Python的自动内存管理使您无需手动分配和释放代码中的内存。
See the SimplePrograms collection of short programs, gradually increasing in length, which show off Python's syntax and readability.
看到短节目simpleprograms收集,长度逐渐增加,这表明了Python的语法和可读性。