TAILIEUCHUNG - Dive Into Python 3

Mark Pilgrim's Dive Into Python 3 is a hands-on guide to Python 3 and its differences from Python 2. As in the original book, Dive Into Python, each chapter starts with a real, complete code sample, proceeds to pick it apart and explain the pieces, and then puts it all back together in a summary at the end. This book includes: | Chapter -1. What s New In Dive Into Python 3 Isn t this where we came in Pink Floyd The Wall . . THE minus level A re you already a Python programmer Did you read the original Dive Into Python Did you buy it on paper If so thanks Are you ready to take the plunge into Python 3 . If so read on. If none of that is true you d be better off . Python 3 comes with a script called 2to3. Learn it. Love it. Use it. Porting Code to Python 3 with 2to3 is a reference of all the things that the 2to3 tool can fix automatically. Since a lot of those things are syntax changes it s a good starting point to learn about a lot of the syntax changes in Python 3. print is now a function x doesn t work c. Case Study Porting chardet to Python 3 documents my ultimately successful effort to port a non-trivial library from Python 2 to Python 3. It may help you it may not. There s a fairly steep learning curve since you need to kind of understand the library first so you can understand why it broke and how I fixed it. A lot of the breakage centers around strings. Speaking of which. Strings. Whew. Where to start. Python 2 had strings and Unicode strings. Python 3 has bytes and strings. That is all strings are now Unicode strings and if you want to deal with a bag of bytes you use the new bytes type. Python 3 will never implicitly convert between strings and bytes so if you re not sure which one you have at any given moment your code will almost certainly break. Read . for more details. Bytes vs. strings comes up again and again throughout the book. I In Files you ll learn the difference between reading files in binary and text mode. Reading and writing files in text mode requires an encoding parameter. Some text file methods count characters but other methods count bytes. If your code assumes that one character one byte it will break on multi-byte characters. In http Web Services the httplib2 module fetches headers and

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.