Core Python Programming

Free Download

Authors:

Series: Prentice Hall Ptr Core Series

ISBN: 9780130260369, 0-13-026036-3

Size: 8 MB (8290791 bytes)

Pages: 907/907

File format:

Language:

Publishing Year:

Category:

Wesley J. Chun9780130260369, 0-13-026036-3

* New to Python? This is the developer’s guide to Python development! * Learn the core features of Python as well as advanced topics such as regular expressions, multithreaded programming, Web/Internet and network development, GUI development with Tk(inter) and more * Also includes features found in the new Python 1.6 and 2.0 releases * CD-ROM: Complete Python distributions (source code, documentation, and various binaries) plus all example scripts in the bookPython is an Internet and systems programming language that is soaring in popularity in today’s fast-paced software development environment, and no wonder: it’s simple (yet robust), object-oriented (yet can be used as a procedural language), extensible, scalable and features an easy to learn syntax that is clear and concise. Python combines the power of a compiled object language like Java and C++ with the ease of use and rapid development time of a scripting language. In fact, it’s syntax is so easy to understand that you are more likely to pick it up faster than any of the other popular scripting languages in use today!In Core Python Programming, Internet software engineer and technical trainer Wesley Chun provides intermediate and experienced developers all they need to know to learn Python-fast. Like all Core Series books, Core Python Programming delivers hundreds of industrial-strength code snippets and examples, all targeted at professional developers who want to leverage their existing skills! In particular, Core Python Programming presents numerous interactive examples that can be entered into the Python interpreter right in front of you!Finally, we present a chapter that shows you step-by-step how to extend Python using C or C++. * Python syntax and style * Development and Run-time Environments * Objects and Python memory management * Standard data types, methods, and operators * Loops and conditionals * Files and Input/Output * Exceptions and error handling * Functions, scope, arguments, and functional programming * Importing modules and module attributes * Object-oriented Programming with classes, methods, and instances * Callable Objects * Extending PythonCoverage of the Python standard module library and client-server application development includes comprehensive introductions to the following topics in Python programming: * Regular expressions * TCP/IP and UDP/IP Network programming using sockets * Operating system interface * GUI development with Tk using Tkinter * Multithreaded programming * Interactive Web/CGI/Internet applications * Executing code in a restricted environment * Inheritance, type emulation, operator overloading, and delegation in an OOP environmentFinally, we provide an introduction to the new features introduced in Python 1.6. These include Unicode string support, the new function invocation syntax which lets the caller provide a tuple of positional arguments and/or a dictionary of keyword arguments, and the new string methods. We also provide a glimpse into features that will only be found in the newer 2.0 release.Every Core Series book: * DEMONSTRATES how to write commercial-quality code * FEATURES dozens of programs and examples! * FOCUSES on the features and functions most important to real developers * PROVIDES objective, unbiased coverage of cutting-edge technologies-no * hype!Core Python Programming delivers: * Coverage of the core parts of the Python language * Real-world insights for developing Web/Internet, network, multithreaded and GUI applications * Tables and charts detailing Python modules, built-in functions, operators, and attributes * Code snippets to try live with Python’s interactive interpreter, hammering the concepts home * Extensive code examples-including several complete sample applicationsCD-ROM includes complete Python source code and documentation distributions for Unix/Linux along with binaries for Windows and Macintosh platforms plus source code for all examples in the book.

Table of contents :
本地磁碟……Page 0
Safari | Core Python Programming……Page 1
Safari | Core Python Programming -> Welcome to Python!……Page 4
file:///D|/Downloads/eDonkey/incoming/(ebook%20-%20HTML%20-%20Python)%20O’Reilly%20-%20Core%20Python/(ebook%20-%20HTML%20-%20Python)%20O’Reilly%20-%20Core%20Python/new_toc.html……Page 5
Safari | Core Python Programming -> Style:Technical, Yet Easy Reading……Page 12
Safari | Core Python Programming -> Author’s Experience with Python……Page 13
Safari | Core Python Programming -> Book Contents……Page 14
Safari | Core Python Programming -> Part I : Core Python……Page 15
Safari | Core Python Programming -> Chapter 1 —Welcome to Python!……Page 16
Safari | Core Python Programming -> Chapter 2 —Getting Started……Page 17
Safari | Core Python Programming -> Chapter 3 —Syntax and Style……Page 18
Safari | Core Python Programming -> Chapter 4 —Python Objects……Page 19
Safari | Core Python Programming -> Chapter 5 —Numbers……Page 20
Safari | Core Python Programming -> Chapter 6 —Sequences: Strings, Lists, and Tuples……Page 21
Safari | Core Python Programming -> Chapter 7 —Dictionaries……Page 22
Safari | Core Python Programming -> Chapter 8 —Conditionals and Loops……Page 23
Safari | Core Python Programming -> Chapter 9 —Files and Input/Output……Page 24
Safari | Core Python Programming -> Chapter 10 —Errors and Exceptions……Page 25
Safari | Core Python Programming -> Chapter 11 —Functions……Page 26
Safari | Core Python Programming -> Chapter 12 —Modules……Page 27
Safari | Core Python Programming -> Chapter 13 —Classes and OOP……Page 28
Safari | Core Python Programming -> Chapter 14 —Execution Environment……Page 29
Safari | Core Python Programming -> Part II : Advanced Topics……Page 30
Safari | Core Python Programming -> Chapter 15 —Regular Expressions……Page 31
Safari | Core Python Programming -> Chapter 16 —Network Programming with Sockets……Page 32
Safari | Core Python Programming -> Chapter 17 —Multithreaded Programming……Page 33
Safari | Core Python Programming -> Chapter 18 —GUI Programming with Tkinter……Page 34
Safari | Core Python Programming -> Chapter 19 —Web Programming……Page 35
Safari | Core Python Programming -> Chapter 20 —Extending Python……Page 36
Safari | Core Python Programming -> Optional Sections……Page 37
Safari | Core Python Programming -> Conventions……Page 38
Safari | Core Python Programming -> Book Support……Page 39
Safari | Core Python Programming -> Acknowledgements……Page 40
Safari | Core Python Programming -> I: CORE PYTHON……Page 43
Safari | Core Python Programming -> 1. Welcome to Python!……Page 44
Safari | Core Python Programming -> What Is Python?……Page 45
Safari | Core Python Programming -> History of Python……Page 46
Safari | Core Python Programming -> Features of Python……Page 47
Safari | Core Python Programming -> Obtaining Python……Page 52
Safari | Core Python Programming -> Obtaining Python……Page 54
Safari | Core Python Programming -> Installing Python……Page 55
Safari | Core Python Programming -> Running Python……Page 57
Safari | Core Python Programming -> Python Documentation……Page 65
Safari | Core Python Programming -> Comparing Python……Page 66
Safari | Core Python Programming -> JPython and Some Nomenclature……Page 68
Safari | Core Python Programming -> Exercises……Page 69
Safari | Core Python Programming -> 2. Getting Started……Page 71
Safari | Core Python Programming -> Program Output, the print Statement, and “Hello World!”……Page 73
Safari | Core Python Programming -> Program Input and the raw_input() Built-in Function……Page 75
Safari | Core Python Programming -> Comments……Page 76
Safari | Core Python Programming -> Operators……Page 77
Safari | Core Python Programming -> Variables and Assignment……Page 80
Safari | Core Python Programming -> Numbers……Page 82
Safari | Core Python Programming -> Strings……Page 83
Safari | Core Python Programming -> Lists and Tuples……Page 84
Safari | Core Python Programming -> Dictionaries……Page 86
Safari | Core Python Programming -> Code Blocks Use Indentation……Page 87
Safari | Core Python Programming -> if Statement……Page 88
Safari | Core Python Programming -> while Loop……Page 90
Safari | Core Python Programming -> for Loop and the range() Built-in Function……Page 91
Safari | Core Python Programming -> Files and the open() Built-in Function……Page 94
Safari | Core Python Programming -> Errors and Exceptions……Page 96
Safari | Core Python Programming -> Functions……Page 97
Safari | Core Python Programming -> Classes……Page 99
Safari | Core Python Programming -> Modules……Page 102
Safari | Core Python Programming -> Exercises……Page 105
Safari | Core Python Programming -> 3. Syntax and Style……Page 109
Safari | Core Python Programming -> Statements and Syntax……Page 110
Safari | Core Python Programming -> Variable Assignment……Page 114
Safari | Core Python Programming -> Identifiers……Page 118
Safari | Core Python Programming -> Basic Style Guidelines……Page 120
Safari | Core Python Programming -> Memory Management……Page 126
Safari | Core Python Programming -> First Python Application……Page 130
Safari | Core Python Programming -> Exercises……Page 135
Safari | Core Python Programming -> 4. Python Objects……Page 137
Safari | Core Python Programming -> Python Objects……Page 138
Safari | Core Python Programming -> Standard Types……Page 140
Safari | Core Python Programming -> Other Built-in Types……Page 142
Safari | Core Python Programming -> Internal Types……Page 144
Safari | Core Python Programming -> Standard Type Operators……Page 148
Safari | Core Python Programming -> Standard Type Built-in Functions……Page 154
Safari | Core Python Programming -> Categorizing the Standard Types……Page 162
Safari | Core Python Programming -> Unsupported Types……Page 168
Safari | Core Python Programming -> Exercises……Page 170
Safari | Core Python Programming -> 5. Numbers……Page 171
Safari | Core Python Programming -> Introduction to Numbers……Page 172
Safari | Core Python Programming -> Integers……Page 174
Safari | Core Python Programming -> Floating Point Real Numbers……Page 176
Safari | Core Python Programming -> Complex Numbers……Page 177
Safari | Core Python Programming -> Operators……Page 179
Safari | Core Python Programming -> Built-in Functions……Page 187
Safari | Core Python Programming -> Related Modules……Page 196
Safari | Core Python Programming -> Exercises……Page 200
Safari | Core Python Programming -> 6. Sequences: Strings, Lists, and Tuples……Page 204
Safari | Core Python Programming -> Sequences……Page 206
Safari | Core Python Programming -> Strings……Page 212
Safari | Core Python Programming -> Strings and Operators……Page 215
Safari | Core Python Programming -> String-only Operators……Page 221
Safari | Core Python Programming -> Built-in Functions……Page 227
Safari | Core Python Programming -> String Built-in Methods……Page 229
Safari | Core Python Programming -> Special Features of Strings……Page 233
Safari | Core Python Programming -> Related Modules……Page 242
Safari | Core Python Programming -> Summary of String Highlights……Page 244
Safari | Core Python Programming -> Lists……Page 246
Safari | Core Python Programming -> Operators……Page 249
Safari | Core Python Programming -> Built-in Functions……Page 254
Safari | Core Python Programming -> List Type Built-in Methods……Page 258
Safari | Core Python Programming -> Special Features of Lists……Page 262
Safari | Core Python Programming -> Tuples……Page 271
Safari | Core Python Programming -> Tuple Operators and Built-in Functions……Page 273
Safari | Core Python Programming -> Special Features of Tuples……Page 275
Safari | Core Python Programming -> Related Modules……Page 280
Safari | Core Python Programming -> *Shallow and Deep Copies……Page 281
Safari | Core Python Programming -> Exercises……Page 286
Safari | Core Python Programming -> 7. Dictionaries……Page 291
Safari | Core Python Programming -> Introduction to Dictionaries……Page 292
Safari | Core Python Programming -> Operators……Page 297
Safari | Core Python Programming -> Built-in Functions……Page 299
Safari | Core Python Programming -> Built-in Methods……Page 304
Safari | Core Python Programming -> Dictionary Keys……Page 308
Safari | Core Python Programming -> Exercises……Page 313
Safari | Core Python Programming -> 8. Conditionals and Loops……Page 317
Safari | Core Python Programming -> if statement……Page 318
Safari | Core Python Programming -> else Statement……Page 320
Safari | Core Python Programming -> elif (a.k.a. else-if ) Statement……Page 323
Safari | Core Python Programming -> while Statement……Page 325
Safari | Core Python Programming -> for Statement……Page 328
Safari | Core Python Programming -> break Statement……Page 334
Safari | Core Python Programming -> continue Statement……Page 336
Safari | Core Python Programming -> pass Statement……Page 338
Safari | Core Python Programming -> else Statement… Take Two……Page 340
Safari | Core Python Programming -> Exercises……Page 343
Safari | Core Python Programming -> 9. Files and Input/Output……Page 348
Safari | Core Python Programming -> File Objects……Page 349
Safari | Core Python Programming -> File Built-in Function [ open() ]……Page 350
Safari | Core Python Programming -> File Built-in Methods……Page 352
Safari | Core Python Programming -> File Built-in Attributes……Page 358
Safari | Core Python Programming -> Standard Files……Page 359
Safari | Core Python Programming -> Command-line Arguments……Page 361
Safari | Core Python Programming -> File System……Page 363
Safari | Core Python Programming -> File Execution……Page 371
Safari | Core Python Programming -> Persistent Storage Modules……Page 372
Safari | Core Python Programming -> Related Modules……Page 375
Safari | Core Python Programming -> Exercises……Page 377
Safari | Core Python Programming -> 10. Errors And Exceptions……Page 382
Safari | Core Python Programming -> What Are Exceptions?……Page 384
Safari | Core Python Programming -> Exceptions in Python……Page 386
Safari | Core Python Programming -> Detecting and Handling Exceptions……Page 389
Safari | Core Python Programming -> *Exceptions as Strings……Page 403
Safari | Core Python Programming -> *Exceptions as Classes……Page 405
Safari | Core Python Programming -> Raising Exceptions……Page 408
Safari | Core Python Programming -> Assertions……Page 411
Safari | Core Python Programming -> Standard Exceptions……Page 413
Safari | Core Python Programming -> *Creating Exceptions……Page 415
Safari | Core Python Programming -> Why Exceptions (Now)?……Page 423
Safari | Core Python Programming -> Why Exceptions at All?……Page 425
Safari | Core Python Programming -> Exceptions and the sys Module……Page 426
Safari | Core Python Programming -> Related Modules……Page 427
Safari | Core Python Programming -> Exercises……Page 428
Safari | Core Python Programming -> 11. Functions……Page 432
Safari | Core Python Programming -> What Are Functions?……Page 433
Safari | Core Python Programming -> Calling Functions……Page 436
Safari | Core Python Programming -> Creating Functions……Page 438
Safari | Core Python Programming -> Passing Functions……Page 441
Safari | Core Python Programming -> Formal Arguments……Page 444
Safari | Core Python Programming -> Positional Arguments……Page 445
Safari | Core Python Programming -> Default Arguments……Page 446
Safari | Core Python Programming -> Why Default Arguments?……Page 447
Safari | Core Python Programming -> Default Function Object Argument Example……Page 450
Safari | Core Python Programming -> Variable-length Arguments……Page 452
Safari | Core Python Programming -> Non-keyword Variable Arguments (Tuple)……Page 453
Safari | Core Python Programming -> Keyword Variable Arguments (Dictionary)……Page 455
Safari | Core Python Programming -> Calling Functions with Variable Argument Objects……Page 458
Safari | Core Python Programming -> Functional Programming……Page 460
Safari | Core Python Programming -> Anonymous Functions and lambda……Page 461
Safari | Core Python Programming -> Built-in Functions: apply(), filter(), map(), reduce()……Page 464
Safari | Core Python Programming -> * apply()……Page 465
Safari | Core Python Programming -> Lines 1 – 4……Page 468
Safari | Core Python Programming -> Lines 6 – 7……Page 469
Safari | Core Python Programming -> Lines 9 – 28……Page 470
Safari | Core Python Programming -> Lines 30-41……Page 471
Safari | Core Python Programming -> filter()……Page 474
Safari | Core Python Programming -> map()……Page 478
Safari | Core Python Programming -> reduce()……Page 485
Safari | Core Python Programming -> Variable Scope……Page 489
Safari | Core Python Programming -> *Recursion……Page 494
Safari | Core Python Programming -> Exercises……Page 496
Safari | Core Python Programming -> 12. Modules……Page 500
Safari | Core Python Programming -> What are Modules?……Page 501
Safari | Core Python Programming -> Modules and Files……Page 502
Safari | Core Python Programming -> Namespaces……Page 505
Safari | Core Python Programming -> Importing Modules……Page 508
Safari | Core Python Programming -> Importing Module Attributes……Page 509
Safari | Core Python Programming -> Module Built-in Functions……Page 512
Safari | Core Python Programming -> Packages……Page 515
Safari | Core Python Programming -> Other Features of Modules……Page 518
Safari | Core Python Programming -> Exercises……Page 520
Safari | Core Python Programming -> 13. Classes and OOP……Page 522
Safari | Core Python Programming -> Introduction……Page 524
Safari | Core Python Programming -> Object-oriented Programming……Page 533
Safari | Core Python Programming -> Classes……Page 538
Safari | Core Python Programming -> Class Attributes……Page 540
Safari | Core Python Programming -> Instances……Page 547
Safari | Core Python Programming -> Instance Attributes……Page 550
Safari | Core Python Programming -> Binding and Method Invocation……Page 560
Safari | Core Python Programming -> Composition……Page 565
Safari | Core Python Programming -> Subclassing and Derivation……Page 567
Safari | Core Python Programming -> Inheritance……Page 569
Safari | Core Python Programming -> Built-in Functions for Classes, Instances, and Other Objects……Page 575
Safari | Core Python Programming -> Type vs. Classes/Instances……Page 583
Safari | Core Python Programming -> Customizing Classes with Special Methods……Page 584
Safari | Core Python Programming -> Privacy……Page 599
Safari | Core Python Programming -> Delegation……Page 600
Safari | Core Python Programming -> Related Modules and Documentation……Page 609
Safari | Core Python Programming -> Exercises……Page 613
Safari | Core Python Programming -> 14. Execution Environment……Page 620
Safari | Core Python Programming -> Callable Objects……Page 622
Safari | Core Python Programming -> Code Objects……Page 630
Safari | Core Python Programming -> Executable Object Statements and Built-in Functions……Page 631
Safari | Core Python Programming -> Executing Other (Python) Programs……Page 643
Safari | Core Python Programming -> Executing Other (Non-Python) Programs……Page 646
Safari | Core Python Programming -> Restricted Execution……Page 653
Safari | Core Python Programming -> Terminating Execution……Page 658
Safari | Core Python Programming -> Related Modules……Page 662
Safari | Core Python Programming -> Exercises……Page 663
Safari | Core Python Programming -> II: Advanced Topics……Page 665
Safari | Core Python Programming -> 15. Regular Expressions……Page 666
Safari | Core Python Programming -> Introduction/Motivation……Page 667
Safari | Core Python Programming -> Special Symbols and Characters for REs……Page 671
Safari | Core Python Programming -> REs and Python……Page 678
Safari | Core Python Programming -> Regular Expression Adventures……Page 694
Safari | Core Python Programming -> Exercises……Page 702
Safari | Core Python Programming -> 16. Network Programming……Page 706
Safari | Core Python Programming -> Introduction……Page 707
Safari | Core Python Programming -> Sockets: Communication Endpoints……Page 711
Safari | Core Python Programming -> Network Programming in Python……Page 714
Safari | Core Python Programming -> Related Modules……Page 727
Safari | Core Python Programming -> Exercises……Page 729
Safari | Core Python Programming -> 17. Multithreaded Programming……Page 732
Safari | Core Python Programming -> Introduction/Motivation……Page 733
Safari | Core Python Programming -> Threads and Processes……Page 735
Safari | Core Python Programming -> Threads and Python……Page 737
Safari | Core Python Programming -> thread Module……Page 742
Safari | Core Python Programming -> threading Module……Page 747
Safari | Core Python Programming -> Exercises……Page 761
Safari | Core Python Programming -> 18. GUI Programming with Tkinter……Page 763
Safari | Core Python Programming -> Introduction……Page 764
Safari | Core Python Programming -> Tkinter and Python Programming……Page 766
Safari | Core Python Programming -> Tkinter Examples……Page 770
Safari | Core Python Programming -> Related Modules and Other GUIs……Page 780
Safari | Core Python Programming -> Exercises……Page 781
Safari | Core Python Programming -> 19. Web Programming……Page 783
Safari | Core Python Programming -> Introduction……Page 784
Safari | Core Python Programming -> Web Surfing with Python: Creating Simple Web Clients……Page 788
Safari | Core Python Programming -> Advanced Web Clients……Page 798
Safari | Core Python Programming -> CGI: Helping Web Servers Process Client Data……Page 804
Safari | Core Python Programming -> Building CGI Application……Page 807
Safari | Core Python Programming -> Advanced CGI……Page 823
Safari | Core Python Programming -> Web (HTTP) Servers……Page 836
Safari | Core Python Programming -> Related Modules……Page 840
Safari | Core Python Programming -> Exercises……Page 843
Safari | Core Python Programming -> 20. Extending Python……Page 848
Safari | Core Python Programming -> Introduction/Motivation……Page 849
Safari | Core Python Programming -> Related Topics……Page 865
Safari | Core Python Programming -> Exercises……Page 866
Safari | Core Python Programming -> Answers to Selected Exercises……Page 867
Safari | Core Python Programming -> A…….Page 880
Safari | Core Python Programming -> Other Reading and References……Page 881
Safari | Core Python Programming -> B…….Page 883
Safari | Core Python Programming -> Other Printed References……Page 884
Safari | Core Python Programming -> Online References……Page 885
Safari | Core Python Programming -> Python Operator Summary……Page 895
Safari | Core Python Programming -> C…….Page 897
Safari | Core Python Programming -> What’s New in Python 2.0?……Page 898
Safari | Core Python Programming -> D…….Page 905
Safari | Core Python Programming……Page 906

Reviews

There are no reviews yet.

Be the first to review “Core Python Programming”
Shopping Cart
Scroll to Top