ebook img

Python developer's handbook PDF

1481 Pages·2001·10.51 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Python developer's handbook

Web Development > Python Developer's Handbook See All Titles Python Developer's Handbook André Dos Santos Lessa Publisher: Sams Publishing First Edition December 12, 2000 ISBN: 0-672-31994-2, 960 pages Buy Print Version Front Matter Table of Contents The Python Developer’s Handbook is designed to expose experienced developers Index to Python and its uses. Beginning with a brief introduction to the language and its About the Author syntax, the book moves quickly into more advanced programming topics, including embedding Python, network programming, GUI toolkits, JPython, Web development, Python/C API, and more. Python is an interpreted, object-oriented programming language. Its syntax is simple and easy to learn, and it encourages programmers to write and think clearly. The Python Developer’s Handbook is carefully written, well-organized introduction to this powerful, fast-growing programming language for experienced developers. Last updated on 1/30/2002 Python Developer's Handbook, © 2002 Sams Publishing © 2002, O'Reilly & Associates, Inc. Web Development > Python Developer's Handbook > Introduction See All Titles < BACK Make Note | Bookmark CONTINUE > 152015024128143245168232148039199167010047123209178152124239215162145093180142147166131082 Introduction When I was a little kid, I had this dream where a snake would rule and dominate the entire world (actually, I guess that a penguin was also part of the dream…but never mind). I didn't pay much attention to the fact at that time because I thought the dream was caused by an overexposure to all those Japanese series that were popping up on the screens. Later, in my teenage years, there was this science project where I had to spend some time studying snakes to display at an exhibition. After analyzing Red Tail boas and coral snakes, I found this 3-year old giant of 10 feet, 40+ pounds. Instantly, I recognized that snake as being the same one that I had seen in my dream years before. Its name was Python, but at that time, I still couldn't figure out what was the relationship between that reptile and the world domination. Fifteen years ago, I was trying to select a channel in my old TV set, when a special program caught my attention—A huge animated foot was dancing in the opening titles. After the program started, there were a group of funny guys who were playing jokes about parrots and lumberjacks. After watching tons of episodes and all their five films, I decided to write a book about them. I noticed that they were called Python too. Maybe that was the answer. That troupe would dominate the entire world. I wanted to let everyone know about it. Initially I had planned to write about the actors and their most famous sketches, but I had to abandon the idea when I realized that my editors wouldn't give me enough time to write a book of approximately 25,030 pages. That would be a nice bestseller, though. Even though none of the previous facts has really happened, both have at least one thing in common—the name Python. Python is also a scripting language whose name's origin has much to do with the English troupe than with the legless reptile. This book will guide you step-by-step through the universe of Python, a fantastic programming language that can help you to implement solutions for almost all types of IT challenges that you might face. Almost all IT-related tasks, such as the manipulation of database systems, or the design of Web-driven applications can be managed using Python. Maybe that's the answer for my dream. For the last couple of months, I've been trying to organize all the information about Python that I have available, arranging them in this book. I can't say that I have included every little thing in the book, but I do know that I have covered the most important aspects of the Python language. Note that along the 5- month development period of this book, Python had several version upgrades, which made things way more difficult to organize. So, I apologize if something important is missing. This book is organized into 18 chapters and some additional appendixes, where each one covers a specific aspect of the language. Inside each chapter, you will find many hints about how to use Python to meet your needs. As you might agree with me, it is impossible to cover every single aspect of the language in such a complete and up-to-date way. That's why I choose to provide Web links to other sources of material that I think will be useful for your learning. What this book covers? A short answer is The book starts with a very extensive review of the language and the modules that come as part of the Python distribution. It goes through Object-Oriented Programming, Networking, Web Development, Graphical Interfaces, and other important topics. The last chapter covers JPython, a version of Python that runs in Java systems. A long answer is Chapter 1 explains what Python is, why Python must be used, where to get support and how to go through each installation process. Chapter 2 is a complete review of the Python programming language. By the end of this chapter, you will learn how to create Python applications. Chapter 3 shows which main modules extensions are currently available and for what purposes they can be used. The focus here is to expand your knowledge about the Python libraries, showing the resources that you already have available in the Python programming language. Chapter 4 demonstrates how to handle exception situations and how to avoid error messages. Chapter 5 introduces the OO methodology in a very complete and direct way. You will be able to easily create and use objects and classes in your programs after reading this chapter. Chapter 6 discusses extending and embedding Python. You will learn how to extend Python methods using other languages and how to call Python methods from within other applications. Chapter 7 explains objects interfacing and distribution. The information provided in this chapter explains objects distribution and how to use them from within other systems. Chapter 8 shows all the database options available within Python. For those that don't know anything about database yet, it explains how databases work and how to execute basic SQL statements. Chapter 9 provides very useful information concerning the use and manipulation of some advanced topics, including images, sounds, threads, and scientific Python Modules. Chapter 10 explains basic network concepts and invites you to play with these concepts using Python programs. Chapter 11 provides information concerning how to use Python for Internet development. It also introduces you to some well-known Python third-party Web applications. Chapter 12 provides information concerning how to use Python for scripting programming. Chapter 13 provides information concerning how to use Python for data parsing and manipulation, such as XML parsing and mail processing. Chapter 14 shows what the available GUI options for graphic designing in Python are. Chapter 15 provides Tkinter information. For those that don't know yet, Tkinter is the standard Python GUI. Chapter 16 shows some performance suggestions, and guides you through the process of writing clean code within style. Chapter 17 introduces a handful programming tools. You will learn how to go through all the development stages without fear, including how to debug, compile, and distribute Python applications. Chapter 18 demonstrates how easy it is to mix Java and Python using JPython. Now that you know that you have a lot of interesting material to learn, I suggest you accept my hint: The best way to read this book is by sitting on a comfortable beach chair, or laying on your bed, and relaxing. If for some reason, if you think the topic is getting boring, just turn the page and go to another chapter until you find something that you like. Later, you can return to where you originally left. This book can be read from the start, or you can go directly to the chapter that teaches a specific functionality. It's your choice! So, what are you waiting for? Turn this page at once, and get ready to start dominating the world. Last updated on 1/30/2002 Python Developer's Handbook, © 2002 Sams Publishing < BACK Make Note | Bookmark CONTINUE > © 2002, O'Reilly & Associates, Inc. <= Return to book index About the Author Acknowledgments Tell Us What You Think! Introduction I: Basic Programming 1. Introduction Introduction to Python Why Use Python? Main Technical Features Python Distribution Installing and Configuring Python Python and Other Languages Patches and Bugs List PSA and the Python Consortium Summary 2. Language Review Language Review The Shell Environment Programs Built-In Data Types Operators Expressions Control Statements Data Structures Functions and Procedures Modules and Packages Input and Output File Handling Summary Code Example 3. Python Libraries Python Libraries Python Services types UserDict UserList operator traceback linecache pickle cPickle copy_reg shelve copy marshal imp parser symbol token keyword tokenize pyclbr code codeop pprint repr py_compile compileall dis new site user __builtin__ __main__ The String Group Miscellaneous Generic Operational System Optional Operational System Debugger Profiler Internet Protocol and Support Internet Data Handling Restricted Execution Multimedia Cryptographic UNIX Specific SGI IRIX Specific Sun OS Specific MS Windows Specific Macintosh Specific Undocumented Modules Summary 4. Exception Handling Exception Handling Standard Exceptions (Getting Help from Other Modules) Raising Exceptions Catching Exceptions try/finally Creating User-defined Exceptions The Standard Exception Hierarchy Summary Code Examples 5. Object-Oriented Programming Object-Oriented Programming An Introduction to Python OOP Python Classes and Instances Methods Handling Special Methods Inheritance Polymorphism Encapsulation Metaclasses Summary Code Examples II: Advanced Programming 6. Extending and Embedding Python Extending and Embedding Python The Python/C API Extending Compiling and Linking Extension Modules SWIG—The Simple Wrapper Interface Generator Other Wrappers Embedding Summary Code Examples 7. Objects Interfacing and Distribution Object Interfacing and Distribution Interfacing Objects Introduction to COM Objects Implementing COM Objects in Python Distributing Objects with Python Summary Code Examples 8. Working with Databases Working with Databases Flat Databases DBM (Database Managers) Databases Object Serialization and Persistent Storage The ODBC Module ADO (ActiveX Data Objects) Using SQL Python DB API Summary 9. Other Advanced Topics Other Advanced Topics Manipulating Images Working with Sounds Restricted Execution Mode Scientific Computing Regular Expressions Threads Summary Code Examples III: Network Programming 10. Basic Network Background Networking Networking Concepts HTTP Accessing URLs FTP SMTP/POP3/IMAP Newsgroups—Telnet and Gopher Summary 11. Web Development Web Development Configuring Web Servers for Python/CGI Scripts Third-Party Internet Applications Other Applications Site Management Tools Summary 12. Scripting Programming Web Programming An Introduction to CGI The cgi Module Creating, Installing, and Running Your Script Python Active Scripting Summary 13. Data Manipulation Parsing and Manipulating Data XML Processing XML-RPC XDR Data Exchange Format Handling Other Markup Languages MIME Parsing and Manipulation Generic Conversion Functions Summary IV: Graphical Interfaces 14. Python and GUIs Python GUI Toolkits The Tkinter Module Overview of Other GUI Modules Designing a Good Interface Summary 15. Tkinter Introduction to Tcl/Tk Tkinter Geometry Management Handling Tkinter Events Tkinter Widgets Designing Applications PMW—Python Mega Widgets Tkinter Resources Summary V: Developing with Python Chapter 16. Development Environment Building Python Applications Development Strategy Integrated Development Environments IDLE Pythonwin Summary 17. Development Tools The Development Process of Python Programs Compiling Python Editing Code Python Scripts Generating an Executable Python Bytecode Interpreter Debugging the Application Profiling Python Distributing Python Applications Summary VI: Python and Java Chapter 18. JPython Welcome to JPython Java Integration Downloading and Installing JPython The Interpreter The JPython Registry Creating Graphical Interfaces Embedding jpythonc Running JPython Applets Summary VII: Appendixes A. Python/C API Python/C API The Very High Level Layer Reference Counting Exception Handling

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.