Product Details
Python How to Program, 1/e

Python How to Program, 1/e
By Harvey M. Deitel, Paul J. Deitel, Jonathan P. Liperi, Ben Wiedermann

List Price: $126.00
Price: $81.67 & eligible for FREE Super Saver Shipping on orders over $25. Details

Availability: Usually ships in 24 hours
Ships from and sold by Amazon.com

45 new or used available from $6.54

Average customer review:

Product Description

The authoritative DEITEL(tm) LIVE-CODE(tm) introduction to Python programming

This new book by the world's leading programming language textbook authors carefully explains how to use Python as a general-purpose programming language and how to program multi-tier, client/server, database-intensive, Internet- and Web-based applications.

Dr. Harvey M. Deitel and Paul J. Deitel are the founders of Deitel & Associates, Inc., the internationally-recognized corporate-training and content-creation organization specializing in Python, Visual Basic® .NET, C#, Visual C++® .NET, Java(tm), C++, C, XML, Perl, Internet, Web, wireless and object technologies. The Deitels are the authors of several worldwide #1 programming-language textbooks, including Java How to Program, 4/e, C++ How to Program, 3/e and Internet & World Wide Web How to Program, 2/e.

For information on current and forthcoming Deitel/Prentice Hall publications including How to Program Series books, Multimedia Cyber Classrooms Complete Training Courses (which include DEITEL(tm) books and Cyber Classrooms) and Web-Based Training Courses please see the last few pages of this book.


Product Details

  • Amazon Sales Rank: #651300 in Books
  • Published on: 2002-02-14
  • Original language: English
  • Number of items: 2
  • Binding: Paperback
  • 1376 pages

Editorial Reviews

From the Back Cover
The authoritative DEITEL™ LIVE-CODE™ introduction to Python programming

This new book by the world's leading programming language textbook authors carefully explains how to use Python as a general-purpose programming language and how to program multi-tier, client/server, database-intensive, Internet- and Web-based applications.

Dr. Harvey M. Deitel and Paul J. Deitel are the founders of Deitel & Associates, Inc., the internationally-recognized corporate-training and content-creation organization specializing in Python, Visual Basic® .NET, C#, Visual C++® .NET, Java™, C++, C, XML, Perl, Internet, Web, wireless and object technologies. The Deitels are the authors of several worldwide #1 programming-language textbooks, including Java How to Program, 4/e, C++ How to Program, 3/e and Internet & World Wide Web How to Program, 2/e.

About the Author

Dr. Harvey M. Deitel, CEO and Chairman of Deitel & Associates, Inc., has 41 years experience in the computing field, including extensive industry and academic experience. Dr. Deitel earned B.S. and M.S. degrees from the Massachusetts Institute of Technology and a Ph.D. from Boston University. He worked on the pioneering virtual-memory operating-systems projects at IBM and MIT that developed techniques now widely implemented in systems such as UNIX, Linux and Windows NT. He has 20 years of college teaching experience, including earning tenure and serving as the Chairman of the Computer Science Department at Boston College before founding Deitel & Associates, Inc., with his son, Paul J. Deitel. He is the author or co-author with Paul Deitel of several dozen books and multimedia packages and is writing many more. With translations published in Japanese, Russian, Spanish, Traditional Chinese, Simplified Chinese, Korean, French, Polish, Italian and Portuguese, Dr. Deitel's texts have earned international recognition. Dr. Deitel has delivered hundreds of professional seminars to major corporations, government organizations and various branches of the military.

Paul J. Deitel, Executive Vice President and Chief Technical Officer of Deitel & Associates, Inc., is a graduate of the Massachusetts Institute of Technology's Sloan School of Management, where he studied Information Technology. Through Deitel & Associates, Inc., he has delivered Java, C, C++ and Internet and World Wide Web courses to industry clients including Compaq, Sun Microsystems, White Sands Missile Range, Rogue Wave Software, Boeing, Dell, Stratus, Fidelity, Cambridge Technology Partners, Open Environment Corporation, One Wave, Hyperion Software, Lucent Technologies, Adra Systems, Entergy, CableData Systems, NASA at the Kennedy Space Center, the National Severe Storm Laboratory, IBM and many other organizations. He has lectured on C++ and Java for the Boston Chapter of the Association for Computing Machinery and has taught satellite-based Java courses through a cooperative venture of Deitel & Associates, Inc., Prentice Hall and the Technology Education Network. He and his father, Dr. Harvey M. Deitel, are the world's best-selling Computer Science textbook authors.

Jonathan Liperi is a senior at Boston University where he has been accepted into the Computer Science department's BA/MA program. He will earn his Master's degree in Computer Science in May 2003. His coursework has included advanced algorithms, queueing theory, computer architecture, computer networks, artificial intelligence, computer graphics, database systems, software engineering and various programming courses (C, C++, Python and Java).

Ben Wiedermann graduated from Boston University magna cum laude with a degree in Computer Science and a minor in Theater Arts. Ben plans to pursue post-graduate work in programming-language theory. Other Deitel publications to which he has contributed include Java How to Program, Fourth Edition; C++ How to Program, Third Edition; Perl How to Program; Internet and World Wide Web How to Program, Second Edition; XML How to Program; e-Business & e-Commerce How to Program and C How to Program, Third Edition.

Excerpt. © Reprinted by permission. All rights reserved.

Live in fragments no longer. Only connect.
Edward Morgan Forster

Welcome to the world of Python programming! Python is a powerful general-purpose programming language that is extremely effective for developing Internet and Web-based, database intensive, multi-tier, client/server systems. This book presents a great variety of leading edge computing technologies, and is our second book on open-source programming languages.

As we write these words, Python 2.2 has just been released, almost to the minute! We have worked hard to incorporate the 2.2 functionality throughout the book. Appendix O presents a few additional 2.2 features.

We hope you will find Python How to Program educational, entertaining and challenging. It was a joy to work on this project. The team at Deitel & Associates develops programming language textbooks and e-Learning materials. We work in almost every major programming language. We noticed something special while working on this book. Our developers and writers commented on how much they like Python. They appreciate its power, its readability and its conciseness. They like its pizzazz. They like the world of open-source software development that is generating an ever-growing base of modules.

Whether you are an instructor, a student, an experienced professional programmer or a novice, this book has much to offer you. Python is an excellent first programming language and is an equally excellent language for developing industrial-strength, commercial applications. For the student and the novice programmer, the early chapters of the book establish a solid foundation in the basics of programming. We discuss many programming models including structured programming, object-based programming, object-oriented programming and event-driven programming. For the professional developer, we have employed the "heavy-duty" Python functionality to create substantial, fully implemented systems. The capstone is the case study on building an online bookstore in Chapter 23—this occupies approximately 70 pages of the text.

The standard basic topics are all here—data types, operators, control structures, arithmetic, strings, decision making, algorithm development, functions, and random numbers and simulation.

The book features a solid treatment of data structures with an early introduction to Python's built-in structures-lists, tuples and dictionaries-and a later rigorous treatment of traditional data structures including queues, stacks, linked lists and binary trees.

The book emphasizes Internet and Web development—we feature an early introduction to CGI then use it in several chapters to build Web-based applications. We include a full-chapter treatment of PSP (Python Server Pages) where we re-engineer the message forum case study presented in Chapter 16.

The book features a detailed, three-chapter treatment of object-oriented programming covering classes, encapsulation, objects, attributes, methods, constructors, destructors, customization, operator overloading, inheritance, base classes, derived classes and polymorphism.

We include a thorough treatment of graphical user interface (GUI) programming, with Tkinter, using event-driven programming, labels, buttons, check buttons, radio buttons, mouse-event handling, keyboard-event handling, layout managers, and a whole range of advanced GUI capabilities for creating and manipulating menus and scrolling components.

We discuss exception handling for making programs more robust. We present a substantial treatment of Python's powerful string-manipulation capabilities and we tackle head-on the difficult—yet enormously powerful—topic of regular expressions.

We discuss file processing, sequential access files, random-access files (and the shelve module). We develop a transaction-processing program and consider object serialization. The discussions of file processing provide a nice lead-in to our treatment of database programming with Python's Database Application Programming Interface (DB-API). We discuss the relational database model and present an introduction to SQL (Structured Query Language).

Many people are familiar with HTML; yet few know that the World Wide Web Consortium—creator of HTML technology—has declared HTML to be a legacy technology that will undergo no further development. Nevertheless, HTML is still important, so we have provided two appendices on it. The world is evolving towards XML (eXtensible Markup Language). In the interim, contemporary Web development is using a transition technology called XHTML. We present two appendices on this important subject and use XHTML in various applications throughout the book. We present a chapter-length general introduction to XML, an absolute must subject for today's Web applications developers. We then include a full-chapter treatment of Python-specific XML processing and include a detailed case study in which we use CGI and XML to build message forums.

Computer applications have generally been good at doing one thing at a time; today's more sophisticated applications need to be able to do many things in parallel, or as we prefer to say in the computer field—concurrently. We provide full chapters on process management and multithreading. These technologies give the Python applications programmer capabilities that used to be available only to systems programmers working down at the operating systems level.

We discuss networking, including the HTTP protocol of the Web, client/server networking with stream sockets, connectionless client/server interaction using datagrams, and we implement a client/server tic-tac-toe game using a multithreaded server.

We present a thorough general discussion of computer security, then deal with some Python-specific security issues. We discuss executing potentially harmful code in a restricted environment using module Bastion. We demonstrate encrypting text with module rotor.

As a capstone exercise for the book, in Chapter 23 we present a detailed case study that implements online bookstore e-business using a great many technologies discussed in the earlier chapters and the appendices. We introduce HTTP sessions and session tracking and build our bookstore as a mufti-tier, client/server system able to handle a variety of clients, including a standard Web browser (using XHTML) and wireless clients (using WML and XHTML Basic).

We present a full chapter on multimedia, including an introduction to PyOpenGL with 3-D graphics examples and an introduction to Alice, a 3D environment that provides objects which can be animated with Python scripts. We demonstrate pygame by designing a CD player, a movie player and a space-cruiser game.

Recognizing the importance of server-side development, we introduce PSP (Python Server Pages) as an alternative to CGI, and we convert the message forum case study from CGI technology to PSP.

The book is loaded with valuable appendices, including the Operator Precedence Chart, ASCII Character Set, Number Systems (binary, octal, decimal, hexadecimal), Python Development Environments, HTML, XHTML, CSS (Cascading Style Sheets), Career Opportunities (with lots of Web resources) and Unicode. We include an appendix on Accessibility (which overviews issues affecting, and resources for, people with disabilities). We close with an appendix on Additional Python 2.2 Features, including discussions on iterators, generators and nested scopes.

As you read this book, if you have an questions, just send an e-mail to deitel@deitel.com. We will respond promptly. Please visit with us from time to time at www.deitel.com and be sure to sign up there for The DEITEL BUZZ e-mail newsletter. We use the Web site and the newsletter to keep our readers up to the minute on Python and our products and services.

Features in Python How to Program

This text contains many additional features, including:

  • "Code Washing."
This is our term for the process we use to format the programs in the book so that they have a carefully commented, open layout. Python How to Program code appears in two colors with easy-to-read, syntax highlighting, including Python keywords, strings and comments. Program code is grouped into small, well-documented pieces. This greatly improves code readability—an especially important goal for us, considering that this book contains 14,930 lines of code.
  • Object-Oriented Programming. Object-oriented programming is the most widely employed technique for developing robust, reusable software. Python was designed to be an object-oriented language, and this text offers a rigorous discussion of Python's various object-oriented features. Data integrity is of particular concern in Python. All Python class data is public by default, but several techniques exist for ensuring data integrity. We discuss these and other object-oriented topics over three detailed chapters. Chapter 7, Object-Based Programming, introduces how to create classes and discusses public, "private" and get/set methods. Chapter 8, Customizing Classes, discusses how to create classes with customized behavior, such as operator overloading, string representation, list and dictionary behavior and methods for customizing attribute access. These concepts are extended in Chapter 9, Object-Oriented Programming: Inheritance, in which we discuss how programmers can create new classes that "absorb" the capabilities of existing classes. This chapter familiarizes the reader with the crucial concepts of polymorphism, abstract clas...


  • Customer Reviews

    Disappointment1
    I purchased Deitel & Deitel's C++ How to Program book long ago, and found it to be comprehensive and extrordinarily helpful.

    When I picked up Python How to Program, I expected the same incredible experience. Instead, I was sorely disappointed by their complete lack of Pythonic thinking. It seems as if they took one of their other How to Program books and ran a code converter across it to migrate it to Python. As a previous reviewer pointed out, some of the examples are horrificly implemented, a clear case of programming in Python with the "C/C++ mentality."

    The examples seemed fun, but no amount of fun can compensate for the fact that this book teaches you nothing about how to truely be a Python programmer. Anyone can read the lexical syntax descriptions on the python.org website and code the examples in this book. It gives me the feeling that Harvey Deitel did not learn Python for any reason other than to write an expensive book about it, and has no idea how to actually use the language.

    A Recipe for Disaster1
    Previously, I reviewed the "Java How to Program" book and found it to be a terrible waste, sure to take all the fun and creativity out of programming. So when I saw this book on the shelf, I flipped through it, hoping that the free-wheeling nature of Python might have lead the Deitels towards a more enlightened approach to instruction. I quickly found that this book has many lessons to teach (although few that I would agree with). For example:

    * Python programmers are NOT having more fun than Java (or other) programmers; all languages are equally stultifying.

    * Learning a language is a tedious task, centered around learning features of the syntax in a prescribed order. (This is like learning to cook by trying ingredients one at a time in alphabetical order, without ever trying to put together something tasty.)

    * The practice of programming has no underlying principles, only an endless series of tips presented in overly-garish multicolor pages. (You'd be better off with a single chapter of "Structure and Interpretation of Computer Programs" than with anything in this book.)

    * Programming is inherently boring, involving endless repetitive typing; it is better for the programmer to do a lot of work than to expect the computer to. For example, consider this example from chapter 4 (Fig 4.7):

    ===================================

    import random

    frequency1 = 0
    frequency2 = 0
    frequency3 = 0
    frequency4 = 0
    frequency5 = 0
    frequency6 = 0

    for roll in range( 1, 6001 ): # 6000 die rolls
    ___face = random.randrange( 1, 7 )

    ___if face == 1: # frequency counted
    ______frequency1 += 1
    ___elif face == 2:
    ______frequency2 += 1
    ___elif face == 3:
    ______frequency3 += 1
    ___elif face == 4:
    ______frequency4 += 1
    ___elif face == 5:
    ______frequency5 += 1
    ___elif face == 6:
    ______frequency6 += 1
    ___else: # simple error handling
    ______print "should never get here!"

    print "Face %13s" % "Frequency"
    print " 1 %13d" % frequency1
    print " 2 %13d" % frequency2
    print " 3 %13d" % frequency3
    print " 4 %13d" % frequency4
    print " 5 %13d" % frequency5
    print " 6 %13d" % frequency6

    ===================================

    (Note I use "_" for blank because Amazon won't indent code properly.) This is 30 lines (42 if you count the copyright notice) for something that a grade-schooler could tell you (I know -- I asked one) is better done with 7 lines:

    import random

    def roll(n, sides=6):
    ____freq = [0] * sides
    ____for roll in range(n):
    ________freq[random.randrange(sides)] += 1
    ____return freq

    print roll(6000)

    I find it a case of unconscionable student-abuse to present examples like this, but I suppose the Deitels had their reasons: perhaps they hadn't introduced lists (or functions) yet. Perhaps lists (or functions) didn't fit readily into their idea of the right order to learn concepts in BASIC (which must therefore be the best order to learn concepts in every other language).

    If you want to learn Python, or learn to Program with Python as your first language, try another book such as "Learning Python" or "Programming Python".

    If you want to ensure that you won't appreciate why Python is the way it is and why it is interesting; if you want to be bored and avoid learning how to do something creative, by all means stick to this book.

    Pure Python Programming Power5
    No doubt about it the most well written and comprehensive Python book to date. This
    Deitel team is hard to beat. They display a complete understanding in all their books
    and are able to deliver an amazingly strong range and depth for all users. This
    is a fluidly based book for all knowledge levels. The first 6 chapters are perfect for
    beginning Pythoners. A really fun part of the book for me, was chapter 24 where you
    get to create a CD player, Movie player, and a Space-Cruiser game. I was also pleased
    that they included a chapter for web accessibility for Internet users with disabilities.
    Most web site designers ignore web site accessibility, but in the future they will eventually have
    to comply with the WCAG web site guidelines. On a side note, did you know that HTML is dead?
    The Appendix has 2 chapters on XHTML, the new replacement for HTML.

    Even though Guido Van Rossum derived the Python name after the popular BBC
    comedy show, the Python language really has 2 sides; one of programming fun and the
    other of programming power. The Deitel team really illustrates Python's power in several areas.
    They delve fully into: control structures, functions, lists, tuples, dictionaries, CGI, OOP, classes,
    inheritance, GUI, exceptions, strings, regular expressions, files, XML, XHTML, databases,
    process management, multithreading, networking, security, data structures, multimedia,
    voiceXML, WML, and Python server pages. Chapter 23 is a complete online
    bookstore program that is pretty impressive.

    I'm very excited about this book and the part that Python will play in the future of
    programming and the Internet. I really see a promising future for Python in e-commerce.
    I can tell you that from 5 years of hardcore web development, Python's big advantage over Perl
    is that its more suited to OOP based CGI programs than Perl. I used Perl for 2 years for nothing but
    web CGI and now I find myself using Python more and more. I'm not knocking Perl, I still use it,
    and it certainly holds it's own areas, but when it comes to CGI and OOP applications development,
    Python is fast, efficient and very tough to beat.

    The CD that comes with the book has the following programs: Alice 99 Interactive 3D,
    Python 2.2, Apache Web Server 1.3.22, Webware 0.6, Pixo Microbrowser 2.1, IBM WebSphere
    Voice Server SDK 2.0 for Win 2k, web site links mentioned in the book and the code examples
    from the book.

    No matter what your skill level in Python, this book will aid you in your web development quest
    and you won't be sorry for the purchase. Be a part of the Internet's new development future. Be a Pythoner.