|
Original |
Translation |
|
7
|
It's usually difficult to get your management to accept open source software, and Python is no exception to this rule. This document discusses reasons to use Python, strategies for winning acceptance, facts and arguments you can use, and cases where you *shouldn't* try to use Python.
|
Il est souvent difficile de faire accepter les logiciels open source par votre encadrement, et Python n'est pas une exception à cette règle. Ce document traite des raisons d'utiliser Python, des stratégies pour le faire accepter, des faits et arguments que vous pouvez exploiter, et des cas où vous *ne devriez pas* essayer d'utiliser python.
|
|
8
|
|
Les raisons de choisir Python
|
|
9
|
There are several reasons to incorporate a scripting language into your development process, and this section will discuss them, and why Python has some properties that make it a particularly good choice.
|
Ce chapitre traite des différentes raisons d'introduire un langage de script dans vos processus de développements, et pourquoi Python est un choix particulièrement judicieux.
|
|
10
|
|
|
|
11
|
|
12
|
For example, the lowest level might define a very low-level set of functions for accessing a hash table. The next level might use hash tables to store the headers of a mail message, mapping a header name like ``Date`` to a value such as ``Tue, 13 May 1997 20:00:54 -0400``. A yet higher level may operate on message objects, without knowing or caring that message headers are stored in a hash table, and so forth.
|
|
|
13
|
Often, the lowest levels do very simple things; they implement a data structure such as a binary tree or hash table, or they perform some simple computation, such as converting a date string to a number. The higher levels then contain logic connecting these primitive operations. Using the approach, the primitives can be seen as basic building blocks which are then glued together to produce the complete product.
|
En général, les niveaux inférieurs réalisent des opérations très simples ; ils implémentent une structure de données comme un arbre binaire ou une table de hachage, ou ils exécutent des opérations simples, comme la conversion d'une date en chaîne de caractères par exemple. Les niveaux supérieurs fournissent la logique pour associer ces opérations primitives. Avec cette approche, les primitives peuvent être considérées comme des simples briques qui sont assemblées afin de construire le produit complet.
|
|
14
|
Why is this design approach relevant to Python? Because Python is well suited to functioning as such a glue language. A common approach is to write a Python module that implements the lower level operations; for the sake of speed, the implementation might be in C, Java, or even Fortran. Once the primitives are available to Python programs, the logic underlying higher level operations is written in the form of Python code. The high-level logic is then more understandable, and easier to modify.
|
|
|
15
|
John Ousterhout wrote a paper that explains this idea at greater length, entitled "Scripting: Higher Level Programming for the 21st Century". I recommend that you read this paper; see the references for the URL. Ousterhout is the inventor of the Tcl language, and therefore argues that Tcl should be used for this purpose; he only briefly refers to other languages such as Python, Perl, and Lisp/Scheme, but in reality, Ousterhout's argument applies to scripting languages in general, since you could equally write extensions for any of the languages mentioned above.
|
|
|
16
|
|
|