- ホーム
- > 洋書
- > 英文書
- > Computer / Languages
Full Description
Already know Python but want to learn more? A lot more? Dive into a variety of topics used in practice for real-world applications. Covers regular expressions, Internet/network programming, GUIs, SQL/databases/ORMs, threading, and Web development. Learn about contemporary development trends such as Google+, Twitter, MongoDB, OAuth, Python 3 migration, and Java/Jython. Presents brand new material on Django, Google App Engine, CSV/JSON/XML, and Microsoft Office. Includes Python 2 and 3 code samples to get you started right away! Provides code snippets, interactive examples, and practical exercises to help build your Python skills.The Complete Developer's Guide to Python Python is an agile, robust, and expressive programming language that continues to build momentum. It combines the power of compiled languages with the simplicity and rapid development of scripting languages. In Core Python Applications Programming, Third Edition, leading Python developer and corporate trainer Wesley Chun helps you take your Python knowledge to the next level.This book has everything you need to become a versatile Python developer. You will be introduced to multiple areas of application development and gain knowledge that can be immediately applied to projects, and you will find code samples in both Python 2 and 3, including migration tips if that's on your roadmap too. Some snippets will even run unmodified on 2.x or 3.x.Learn professional Python style, best practices, and good programming habits Build clients and servers using TCP, UDP, XML-RPC, and be exposed to higher-level libraries like SocketServer and Twisted Develop GUI applications using Tkinter and other available toolkits Improve application performance by writing extensions in C/C++, or enhance I/O-bound code with multithreading Discover SQL and relational databases, ORMs, and even non-relational (NonSQL) databases like MongoDB Learn the basics of Web programming, including Web clients and servers, plus CGI and WSGI Expose yourself to regular expressions and powerful text processing tools for creating and parsing CSV, JSON, and XML data Interface with popular Microsoft Office applications such as Excel, PowerPoint, and Outlook using COM client programming Dive deeper into Web development with the Django framework and cloud computing with Google App Engine Explore Java programming with Jython, the way to run Python code on the JVM Connect to Web services Yahoo! Finance to get stock quotes, or Yahoo! Mail, Gmail, and others to download or send e-mailJump into the social media craze by learning how to connect to the Twitter and Google+ networks Core Python Applications Programming, Third Edition, deliversBroad coverage of a variety of areas of development used in real-world applications today Powerful insights into current and best practices for the intermediate Python programmer Dozens of code examples, from quick snippets to full-fledged applications A variety of exercises at the end of every chapter to help hammer the concepts home
Contents
Preface xv Acknowledgments xxviiAbout the Author xxxiPart I: General Application Topics 1Chapter 1: Regular Expressions 21.1 Introduction/Motivation 31.2 Special Symbols and Characters 61.3 Regexes and Python 161.4 Some Regex Examples 361.5 A Longer Regex Example 411.6 Exercises 48Chapter 2: Network Programming 532.1 Introduction 542.2 What Is Client/Server Architecture? 542.3 Sockets: Communication Endpoints 582.4 Network Programming in Python 612.5 The SocketServer Module 792.6 Introduction to the Twisted Framework 842.7 Related Modules 882.8 Exercises 89Chapter 3: Internet Client Programming 943.1 What Are Internet Clients? 953.2 Transferring Files 963.3 Network News 1043.4 E-Mail 1143.5 Related Modules 1463.6 Exercises 148Chapter 4: Multithreaded Programming 1564.1 Introduction/Motivation 1574.2 Threads and Processes 1584.3 Threads and Python 1604.4 The thread Module 1644.5 The threading Module 1694.6 Comparing Single vs. Multithreaded Execution 1804.7 Multithreading in Practice 1824.8 Producer-Consumer Problem and the Queue/queue Module 2024.9 Alternative Considerations to Threads 2064.10 Related Modules 2094.11 Exercises 210Chapter 5: GUI Programming 2135.1 Introduction 2145.2 Tkinter and Python Programming 2165.3 Tkinter Examples 2215.4 A Brief Tour of Other GUIs 2365.5 Related Modules and Other GUIs 2475.6 Exercises 250Chapter 6: Database Programming 2536.1 Introduction 2546.2 The Python DB-API 2596.3 ORMs 2896.4 Non-Relational Databases 3096.5 Related References 3166.6 Exercises 319Chapter 7: Programming Microsoft Office 3247.1 Introduction 3257.2 COM Client Programming with Python 3267.3 Introductory Examples 3287.4 Intermediate Examples 3387.5 Related Modules/Packages 3577.6 Exercises 357Chapter 8: Extending Python 3648.1 Introduction/Motivation 3658.2 Extending Python by Writing Extensions 3688.3 Related Topics 3848.4 Exercises 388Part II: Web Development 389Chapter 9: Web Clients and Servers 3909.1 Introduction 3919.2 Python Web Client Tools 3969.3 Web Clients 4109.4 Web (HTTP) Servers 4289.5 Related Modules 4339.6 Exercises 436Chapter 10: Web Programming: CGI and WSGI 44110.1 Introduction 44210.2 Helping Web Servers Process Client Data 44210.3 Building CGI Applications 44610.4 Using Unicode with CGI 46410.5 Advanced CGI 46610.6 Introduction to WSGI 47810.7 Real-World Web Development 48710.8 Related Modules 48810.9 Exercises 490Chapter 11: Web Frameworks: Django 49311.1 Introduction 49411.2 Web Frameworks 49411.3 Introduction to Django 49611.4 Projects and Apps 50111.5 Your "Hello World" Application (A Blog) 50711.6 Creating a Model to Add Database Service 50911.7 The Python Application Shell 51411.8 The Django Administration App 51811.9 Creating the Blog's User Interface 52711.10 Improving the Output 53711.11 Working with User Input 54211.12 Forms and Model Forms 54611.13 More About Views 55111.14 Look-and-Feel Improvements 55311.15 Unit Testing 55411.16 An Intermediate Django App: The TweetApprover 56411.17 Resources 59711.18 Conclusion 59711.19 Exercises 598Chapter 12: Cloud Computing: Google App Engine 60412.1 Introduction 60512.2 What Is Cloud Computing? 60512.3 The Sandbox and the App Engine SDK 61212.4 Choosing an App Engine Framework 61712.5 Python 2.7 Support 62612.6 Comparisons to Django 62812.7 Morphing "Hello World" into a Simple Blog 63112.8 Adding Memcache Service 64712.9 Static Files 65112.10 Adding Users Service 65212.11 Remote API Shell 65412.12 Lightning Round (with Python Code) 65612.13 Sending Instant Messages by Using XMPP 66012.14 Processing Images 66212.15 Task Queues (Unscheduled Tasks) 66312.16 Profiling with Appstats 67012.17 The URLfetch Service 67212.18 Lightning Round (without Python Code) 67312.19 Vendor Lock-In 67512.20 Resources 67612.21 Conclusion 67912.22 Exercises 680Chapter 13: Web Services 68413.1 Introduction 68513.2 The Yahoo! Finance Stock Quote Server 68513.3 Microblogging with Twitter 69013.4 Exercises 707Part III: Supplemental/Experimental 713Chapter 14: Text Processing 71414.1 Comma-Separated Values 71514.2 JavaScript Object Notation 71914.3 Extensible Markup Language 72414.4 References 73814.5 Related Modules 74014.6 Exercises 740Chapter 15: Miscellaneous 74315.1 Jython 74415.2 Google+ 74815.3 Exercises 759Appendix A: Answers to Selected Exercises 763Appendix B: Reference Tables 768Appendix C: Python 3: The Evolution of a Programming Language 798C.1 Why Is Python Changing? 799C.2 What Has Changed? 799C.3 Migration Tools 805C.4 Conclusion 806C.5 References 806Appendix D: Python 3 Migration with 2.6+ 807D.1 Python 3: The Next Generation 807D.2 Integers 809D.3 Built-In Functions 812D.4 Object-Oriented Programming: Two Different Class Objects 814D.5 Strings 815D.6 Exceptions 816D.7 Other Transition Tools and Tips 817D.8 Writing Code That is Compatible in Both Versions 2.x and 3.x 818D.9 Conclusion 822Index 823