Библиотека OOArt.ru, книги о программировании и разработке ПО.

OOArt.ru - объектно-ориентированное искусство

Книг: 85

Beginning Python From Novice to Professional

Автор(ы): Magnus Lie Hetland
Язык: английский
Формат файла: pdf
Год выхода: 2005
Страниц: 641
Размер: 13.26 MB
Скачать

Introduction

A C program is like a fast dance on a newly waxed dance floor by people carrying razors.
—Waldi Ravens

C++: Hard to learn and built to stay that way.
—Anonymous

Java is, in many ways, C++––.
—Michael Feldman

And now for something completely different . . .
—Monty Python’s Flying Circus

I ’ve started this introduction with a few quotes to set the tone for the book—which is rather informal. In the hope of making it an easy read, I’ve tried to approach the topic of Python programming with a healthy dose of humor, and true to the traditions of the Python community, much of this humor is related to Monty Python sketches. As a consequence, some of my examples may seem a bit silly; I hope you will bear with me. (And, yes, the name Python is derived from Monty Python, not from snakes belonging to the family Pythonidae.)

In this introduction, I give you a quick look at what Python is, why you should use it, who uses it, who this book’s intended audience is, and how the book is organized.

So, what is Python, and why should you use it? To quote an official blurb (available from http://www.python.org/doc/essays/blurb.php), it is “an interpreted, object-oriented, high- level programming language with dynamic semantics.” Many of these terms will become clear as you read this book, but the gist of it is that Python is a programming language that knows how to stay out of your way when you write your programs. It enables you to implement the functionality you want without any hassle, and lets you write programs that are clear and read- able (much more so than programs in most other currently popular programming languages).

Even though Python might not be as fast as compiled languages such as C or C++, what you save in programming time will probably make Python worth using; in most programs the speed difference won’t be noticeable anyway. If you are a C programmer, you can easily implement the critical parts of your program in C at a later date, and have them interoperate with the Python parts. If you haven’t done any programming before (and perhaps are a bit confused by my references to C and C++), Python’s combination of simplicity and power make it an ideal choice as a place to start.

So, who uses Python? Since Guido van Rossum created the language in the early 1990s, its following has grown steadily, and interest has increased markedly in the last few years. Python is used extensively for system administration tasks (it is, for example, a vital component of several Linux distributions), but it is also used to teach programming to complete beginners. NASA uses Python for several of its software systems, and has adopted it as the standard scripting language for its Integrated Planning System; Industrial Light & Magic uses Python in its production of special effects for large-budget feature films; Yahoo! uses it (among other things) to manage its discussion groups; and Google has used it to implement many components of its Web crawler and search engine. Python is being used in such diverse areas as computer games and bioinfor- matics. Soon one might as well ask, who isn’t using it?

This book is for those of you who want to learn how to program in Python. It is intended to suit a wide audience, from neophyte programmer to advanced computer wiz. If you have never programmed before, you should start by reading Chapter 1 and continue until you find that things get too advanced for you (if, indeed, they do). Then you should start practicing, and write some programs of your own. When the time is right, you can return to the book and proceed with the more intricate stuff.

If you already know how to program, then some of the introductory material might not be new to you (although there will probably be some surprising details here and there). You could skim through the early chapters to get an idea of how Python works, or perhaps read through Appendix A, “The Short Version,” which is based on my online Python tutorial “Instant Python.” It will get you up to speed on the most important Python concepts. After getting the big picture, you could jump straight to Chapter 10 (which describes the Python standard libraries).

The second half of the book consists of ten programming projects, which show off various capabilities of the Python language. These projects should be of interest to beginner and expert alike. Although some of the material in the later projects may be a bit difficult for an inexperi- enced programmer, following the projects in order (after reading the material in the first part of the book) should be possible.

The projects touch upon a wide range of topics, most of which will be very useful to you when writing programs of your own. You will learn how to do things that may seem completely out of reach to you at this point, such as creating a chat server, a peer-to-peer file sharing system, or a full-fledged graphical computer game. Although much of the material may seem hard at first glance, I think you will be surprised by how easy most of it really is. If you’d like to download the source code, it’s available from http://www.apress.com.

Well, that’s it. I always find long introductions boring myself, so I’ll let you continue with your Pythoneering, either in Chapter 1 or in Appendix A. Good luck, and happy hacking.


Пока комментариев нет

Оставить комментарий


Ваш e-mail не будет опубликован

© SignCeption, 2009