Search This Blog

Labels

Friday, December 17, 2010

《扩展和嵌入Python解释器(译稿)》0 Abstract——Extending and Embedding the Python Interpreter Release 2.5

Abstract

摘 要

Python is an interpreted, object-oriented programming language. This document describes how to write modules in C or C++ to extend the Python interpreter with new modules. Those modules can define new functions but also new object types and their methods. The document also describes how to embed the Python interpreter in another application, for use as an extension language. Finally, it shows how to compile and link extension modules so that they can be loaded dynamically (at run time) into the interpreter, if the underlying operating system supports this feature.

Python是一门解释性的,面向对象的程序语言。本文档描述了如何用C或C ++编写模块来为Python解释器扩展新的模块。这些模块能定义新的函数,也能定义新的对象类型和它们的方法。本文档也描述了如何将解释器嵌入另外的应用程序,以用作语言的扩展。最后,展示了如何编译和链接扩展模块使之能动态地(在运行时)载入解释器,如果操作系统底层支持这个特征的话。

This document assumes basic knowledge about Python. For an informal introduction to the language, see the Python Tutorial. The Python Reference Manualgives a more formal definition of the language. The Python Library Reference documents the existing object types, functions and modules (both built-in and written in Python) that give the language its wide application range.

本文档假设读者已具备了Python的基础知识。对Python语言的非正式介绍,可以参考Python Tutorial。而Python Reference Manual则给出了更正式的说明。Python Library Reference 记录了现有的对象类型、函数和模块(两者都是Python内建对象并由Python实现),这些为Python提供了广泛的应用范围。

For a detailed description of the whole Python/C API, see the separate Python/C API Reference Manual.

整个 Python/C API 体系的详细描述,可以参考Python/C API Reference Manual.

No comments:

Post a Comment