Beginning Python: Using Python 2.6 and Python 3.1 (Wrox Programmer to Programmer)
معرفی کتاب «Beginning Python: Using Python 2.6 and Python 3.1 (Wrox Programmer to Programmer)» نوشتهٔ James Z. Payne، منتشرشده توسط نشر Wrox [Imprint] John Wiley & Sons در سال 2010. این کتاب در 2 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است. «Beginning Python: Using Python 2.6 and Python 3.1 (Wrox Programmer to Programmer)» در دستهٔ بدون دستهبندی قرار دارد.
Beginning Python: Using Python 2.6 and Python 3.1 introduces this open source, portable, interpreted, object-oriented programming language that combines remarkable power with clear syntax. This book enables you to quickly create robust, reliable, and reusable Python applications by teaching the basics so you can quickly develop Web and scientific applications, incorporate databases, and master systems tasks on various operating systems, including Linux, MAC OS, and Windows. You'll get a comprehensive tutorial that guides you from writing simple, basic Python scripts all the way through complex concepts, and also features a reference of the standard modules with examples illustrating how to implement features in the various modules. Plus, the book covers using Python in specific program development domains, such as XML, databases, scientific applications, network programming, and Web development. Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file. Beginning Python: Using Python 2.6 and Python 3.1 1 About the Author 11 Credits 13 Acknowledgments 15 Contents 17 Introduction 29 Who This Book Is For 29 What This Book Covers 29 How This Book Is Structured 30 What You Need to Use This Book 33 Conventions 33 Source Code 35 Errata 35 p2p.wrox.com 35 Part I: Dipping Your Toe into Python 37 Chapter 1: Programming Basics and Strings 39 How Programming is Different from Using a Computer 39 The First Steps 41 Beginning to Use Python—Strings 43 Putting Two Strings Together 47 Putting Strings Together in Different Ways 48 Summary 49 Exercises 50 Chapter 2: Numbers and Operators 51 Different Kinds of Numbers 51 Program Files 54 Using Numbers 60 Summary 64 Exercises 65 Chapter 3: Variables—Names for Values 67 Referring to Data—Using Names for Data 67 Using More Built-in Types 70 Other Common Sequence Properties 79 Summary 83 Exercises 84 Part II: Python Language and the Standard Library 85 Chapter 4: Making Decisions 87 Comparing Values—Are They the Same? 87 Doing the Opposite—Not Equal 89 Comparing Values—Which One Is More? 90 Reversing True and False 92 Looking for the Results of More Than One Comparison 92 Repetition 96 Handling Errors 101 Summary 103 Exercises 105 Chapter 5: Functions 107 Putting Your Program into Its Own File 107 Functions: Grouping Code under a Name 109 Layers of Functions 124 Summary 125 Exercises 126 Chapter 6: Classes and Objects 129 Thinking About Programming 129 Defining a Class 132 Summary 143 Exercises 144 Chapter 7: Organizing Programs 147 Modules 148 Packages 154 Modules and Packages 156 Basics of Testing Your Modules and Packages 160 Summary 160 Exercises 161 Chapter 8: Files and Directories 163 File Objects 163 Paths and Directories 167 Exceptions in os 168 Summary 178 Exercises 178 Chapter 9: Other Features of the Language 179 Lambda and Filter: Short Anonymous Functions 179 Map: Short-Circuiting Loops 180 Decisions within Lists—List Comprehension 181 Generating Iterators for Loops 182 Special String Substitution Using Dictionaries 184 Featured Modules 185 Summary 192 Exercises 192 Chapter 10: Building a Module 193 Exploring Modules 193 Creating Modules and Packages 198 Working with Classes 199 Finishing Your Modules 202 Creating a Whole Module 215 Installing Your Modules 219 Summary 223 Exercises 224 Chapter 11: Text Processing 225 Why Text Processing Is So Useful 225 Navigating the File System with the os Module 228 Working with Regular Expressions and the re Module 235 Summary 239 Exercises 240 Part III: Putting Python to Work 241 Chapter 12: Testing 243 Assertions 244 Test Cases and Test Suites 245 Test Fixtures 249 Putting It All Together with Extreme Programming 252 Formal Testing in the Software Life Cycle 260 Summary 261 Chapter 13: Writing a GUI with Python 263 GUI Programming Toolkits for Python 264 Tkinter Introduction 265 Creating GUI Widgets with Tkinter 265 Summary 274 Exercises 274 Chapter 14: Accessing Databases 275 Working with DBM Persistent Dictionaries 276 Working with Relational Databases 281 Using the Python Database APIs 288 Summary 298 Exercises 299 Chapter 15: Using Python for XML 301 What Is XML? 301 What Is a Schema/DTD? 304 Document Type Definitions 304 Schemas 306 XPath 308 HTML as a Subset of XML 308 XML Libraries Available for Python 310 What Is SAX? 310 Why Use SAX or DOM 311 SAX and DOM Parsers Available for Python 312 Intro to XSLT 316 What Is lxml? 316 Element Classes 317 Parsing with lxml 319 Summary 321 Exercises 321 Chapter 16: Network Programming 323 Understanding Protocols 325 Sending Internet E-mail 329 Retrieving Internet E-mail 341 Socket Programming 350 Other Topics 368 Summary 370 Exercises 371 Chapter 17: Extension Programming with C 373 Extension Module Outline 374 Building and Installing Extension Modules 376 Passing Parameters from Python to C 378 Returning Values from C to Python 381 The LAME Project 382 The LAME Extension Module 386 Using Python Objects from C Code 399 Summary 402 Exercises 402 Chapter 18: Numerical Programming 403 Numbers in Python 404 Mathematics 410 Complex Numbers 414 Arrays 416 Summary 420 Exercises 420 Chapter 19: An Introduction to Django 423 What Are Frameworks and Why Would I Use One? 424 Other Features of Web Frameworks 424 Django—How It All Began 425 Understanding Django’s Architecture 426 Working with Templates 432 Using Templates and Views 434 Creating a Model: Creating an Application 439 Summary 441 Exercises 442 Chapter 20: Web Applications and Web Services 443 REST: The Architecture of the Web 444 HTTP: Real-World REST 447 CGI: Turning Scripts into Web Applications 453 HTML Forms’ Limited Vocabulary 458 Safety When Accessing Form Values 459 Building a Wiki 464 Web Services 477 REST Web Services 478 XML-RPC 492 SOAP 501 Documenting Your Web Service API 508 Choosing a Web Service Standard 514 Web Service Etiquette 515 Summary 516 Exercises 516 Chapter 21: Integrating Java with Python 517 Scripting within Java Applications 518 Comparing Python Implementations 519 Installing Jython 519 Running Jython 520 Running Jython on Your Own 524 Packaging Jython-Based Applications 524 Integrating Java and Jython 525 Testing from Jython 542 Embedding the Jython Interpreter 543 Handling Differences between C-Python and Jython 546 Summary 547 Exercises 548 Part IV: Appendices 549 Appendix A: Answers to the Exercises 551 Chapter 1 551 Chapter 2 552 Chapter 3 553 Chapter 4 555 Chapter 5 558 Chapter 6 561 Chapter 7 566 Chapter 8 568 Chapter 9 570 Chapter 10 570 Chapter 11 571 Chapter 13 572 Chapter 14 572 Chapter 15 574 Chapter 16 576 Chapter 17 579 Chapter 18 579 Chapter 19 581 Chapter 20 581 Chapter 21 583 Appendix B: Online Resources 585 Software 585 For More Information 587 Appendix C: What’s New in Python 3.1 589 Print Is Now a Function 589 Certain APIs Return Views and Iterators 589 Integers 590 Unicode and 8-bit 590 Exceptions 590 Classes 591 Comparisons, Operators, and Methods 591 Syntactical Changes 591 Packages and Modules 592 Builtins 593 The 2to3 Tool 594 Appendix D: Glossary 595 Index 605 Explains the basics of quickly developing Web and scientific applications, incorporating databases, and mastering systems tasks on various operating systems, in a guide that also covers basic scripts and standard modules in specific program development domains.
دانلود کتاب Beginning Python: Using Python 2.6 and Python 3.1 (Wrox Programmer to Programmer)